[Wine-patches] [eterhack] winepath: Do not convert path a second time (eterbug #6934).

Alexander Morozov amorozov на etersoft.ru
Сб Мар 5 18:01:25 MSK 2011


----------- следующая часть -----------
From 949723050a4696e4a5a7825417349677dc33a3d3 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Sat, 5 Mar 2011 17:43:37 +0300
Subject: [eterhack] winepath: Do not convert path a second time (eterbug #6934).

---
 programs/winepath/winepath.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/programs/winepath/winepath.c b/programs/winepath/winepath.c
index 6e5f58d..3e1871b 100644
--- a/programs/winepath/winepath.c
+++ b/programs/winepath/winepath.c
@@ -260,6 +260,7 @@ int wmain(int argc, WCHAR *argv[])
             HeapFree(GetProcessHeap(), 0, ntpath);
         }
         if (outputformats & WINDOWSFORMAT) {
+#if 0
             WCHAR* windows_name;
             char* unix_name;
             DWORD size;
@@ -276,6 +277,16 @@ int wmain(int argc, WCHAR *argv[])
             }
             else printf("%c", separator);
             HeapFree( GetProcessHeap(), 0, unix_name );
+#else
+            char* path;
+            DWORD size;
+
+            size = WideCharToMultiByte(CP_UNIXCP, 0, argv[i], -1, NULL, 0, NULL, NULL);
+            path = HeapAlloc(GetProcessHeap(), 0, size);
+            WideCharToMultiByte(CP_UNIXCP, 0, argv[i], -1, path, size, NULL, NULL);
+            printf("%s\n", path);
+            HeapFree(GetProcessHeap(), 0, path);
+#endif
         }
     }
 
-- 
1.7.4.1



Подробная информация о списке рассылки Wine-patches