[PATCH] comdlg32: Exclude the driver path from the result [bug 13832]

Detlef Riekenberg wine.dev at web.de
Sun Feb 12 17:26:53 CST 2012


regression introduced by 4b53154f361b9fdc504be5e099e84c6686f940fe

--
By by ... Detlef
---
 dlls/comdlg32/printdlg.c       |    4 ++++
 dlls/comdlg32/tests/printdlg.c |    5 -----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/dlls/comdlg32/printdlg.c b/dlls/comdlg32/printdlg.c
index aea5224..d074563 100644
--- a/dlls/comdlg32/printdlg.c
+++ b/dlls/comdlg32/printdlg.c
@@ -322,6 +322,8 @@ static BOOL PRINTDLG_CreateDevNames(HGLOBAL *hmem, const char* DeviceDriverName,
     char buf[260];
     DWORD dwBufLen = sizeof(buf);
 
+    DeviceDriverName = strrchr(DeviceDriverName, '\\') + 1;
+
     size = strlen(DeviceDriverName) + 1
             + strlen(DeviceName) + 1
             + strlen(OutputPort) + 1
@@ -365,6 +367,8 @@ static BOOL PRINTDLG_CreateDevNamesW(HGLOBAL *hmem, LPCWSTR DeviceDriverName,
     WCHAR bufW[260];
     DWORD dwBufLen = sizeof(bufW) / sizeof(WCHAR);
 
+    DeviceDriverName = strrchrW(DeviceDriverName, '\\') + 1;
+
     size = sizeof(WCHAR)*lstrlenW(DeviceDriverName) + 2
             + sizeof(WCHAR)*lstrlenW(DeviceName) + 2
             + sizeof(WCHAR)*lstrlenW(OutputPort) + 2
diff --git a/dlls/comdlg32/tests/printdlg.c b/dlls/comdlg32/tests/printdlg.c
index cad080d..c295df0 100644
--- a/dlls/comdlg32/tests/printdlg.c
+++ b/dlls/comdlg32/tests/printdlg.c
@@ -200,9 +200,7 @@ static void test_PrintDlgA(void)
 
         /* The Driver Entry does not include a Path */
         ptr = strrchr(driver, '\\');
-        todo_wine {
         ok( ptr == NULL, "got %p for '%s' (expected NULL for a simple name)\n", ptr, driver);
-        }
 
         /* The Driver Entry does not have an extension (fixed to ".drv") */
         ptr = strrchr(driver, '.');
@@ -220,11 +218,8 @@ static void test_PrintDlgA(void)
             res, GetLastError(), ptr, buffer);
 
         if (ptr) ptr[0] = '\0';
-        todo_wine {
         ok( lstrcmpiA(driver, buffer) == 0,
             "got driver '%s' (expected '%s')\n", driver, buffer);
-        }
-
     }
 
     GlobalUnlock(pDlg->hDevNames);
-- 
1.7.5.4




More information about the wine-patches mailing list