Michael Stefaniuc : winefile: Don't use _tsplitpath().

Alexandre Julliard julliard at winehq.org
Tue Aug 25 08:44:45 CDT 2009


Module: wine
Branch: master
Commit: 3dc7bceb48a28df712a0745d95eb6419648f9a26
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3dc7bceb48a28df712a0745d95eb6419648f9a26

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Tue Aug 25 00:23:55 2009 +0200

winefile: Don't use _tsplitpath().

---

 programs/winefile/splitpath.c |   31 ++++++++++++++-----------------
 programs/winefile/winefile.c  |   14 +++++++-------
 programs/winefile/winefile.h  |    9 ---------
 3 files changed, 21 insertions(+), 33 deletions(-)

diff --git a/programs/winefile/splitpath.c b/programs/winefile/splitpath.c
index d4a11d7..7425147 100644
--- a/programs/winefile/splitpath.c
+++ b/programs/winefile/splitpath.c
@@ -19,8 +19,6 @@
 #include "winefile.h"
 
 
-#ifdef __WINE__
-
 void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext)
 {
         const WCHAR* end; /* end of processed string */
@@ -73,25 +71,24 @@ void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR*
 		*dir = '\0';
 	}
 }
-#endif /* __WINE__ */
 
 
 /*
 void main()	// test splipath()
 {
-	TCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
-
-	_tsplitpath(L"x\\y", drv, dir, name, ext);
-	_tsplitpath(L"x\\", drv, dir, name, ext);
-	_tsplitpath(L"\\x", drv, dir, name, ext);
-	_tsplitpath(L"x", drv, dir, name, ext);
-	_tsplitpath(L"", drv, dir, name, ext);
-	_tsplitpath(L".x", drv, dir, name, ext);
-	_tsplitpath(L":x", drv, dir, name, ext);
-	_tsplitpath(L"a:x", drv, dir, name, ext);
-	_tsplitpath(L"a.b:x", drv, dir, name, ext);
-	_tsplitpath(L"W:\\/\\abc/Z:~", drv, dir, name, ext);
-	_tsplitpath(L"abc.EFGH:12345", drv, dir, name, ext);
-	_tsplitpath(L"C:/dos/command.com", drv, dir, name, ext);
+	WCHAR drv[_MAX_DRIVE+1], dir[_MAX_DIR], name[_MAX_FNAME], ext[_MAX_EXT];
+
+	_wsplitpath(L"x\\y", drv, dir, name, ext);
+	_wsplitpath(L"x\\", drv, dir, name, ext);
+	_wsplitpath(L"\\x", drv, dir, name, ext);
+	_wsplitpath(L"x", drv, dir, name, ext);
+	_wsplitpath(L"", drv, dir, name, ext);
+	_wsplitpath(L".x", drv, dir, name, ext);
+	_wsplitpath(L":x", drv, dir, name, ext);
+	_wsplitpath(L"a:x", drv, dir, name, ext);
+	_wsplitpath(L"a.b:x", drv, dir, name, ext);
+	_wsplitpath(L"W:\\/\\abc/Z:~", drv, dir, name, ext);
+	_wsplitpath(L"abc.EFGH:12345", drv, dir, name, ext);
+	_wsplitpath(L"C:/dos/command.com", drv, dir, name, ext);
 }
 */
diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c
index e45ee99..aed5b38 100644
--- a/programs/winefile/winefile.c
+++ b/programs/winefile/winefile.c
@@ -1386,7 +1386,7 @@ static ChildWnd* alloc_child_window(LPCTSTR path, LPITEMIDLIST pidl, HWND hwnd)
 	{
 		lstrcpy(child->path, path);
 
-		_tsplitpath(path, drv, dir, name, ext);
+		_wsplitpath(path, drv, dir, name, ext);
 	}
 
 	lstrcpy(child->filter_pattern, sAsterics);
@@ -2101,14 +2101,14 @@ static BOOL activate_drive_window(LPCTSTR path)
 	TCHAR drv1[_MAX_DRIVE], drv2[_MAX_DRIVE];
 	HWND child_wnd;
 
-	_tsplitpath(path, drv1, 0, 0, 0);
+	_wsplitpath(path, drv1, 0, 0, 0);
 
 	/* search for a already open window for the same drive */
 	for(child_wnd=GetNextWindow(Globals.hmdiclient,GW_CHILD); child_wnd; child_wnd=GetNextWindow(child_wnd, GW_HWNDNEXT)) {
 		ChildWnd* child = (ChildWnd*) GetWindowLongPtr(child_wnd, GWLP_USERDATA);
 
 		if (child) {
-			_tsplitpath(child->root.path, drv2, 0, 0, 0);
+			_wsplitpath(child->root.path, drv2, 0, 0, 0);
 
 			if (!lstrcmpi(drv2, drv1)) {
 				SendMessage(Globals.hmdiclient, WM_MDIACTIVATE, (WPARAM)child_wnd, 0);
@@ -2198,7 +2198,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
 				if (activate_drive_window(root))
 					return 0;
 
-				_tsplitpath(root, drv, 0, 0, 0);
+				_wsplitpath(root, drv, 0, 0, 0);
 
 				if (!SetCurrentDirectory(drv)) {
 					display_error(hwnd, GetLastError());
@@ -3690,7 +3690,7 @@ static void refresh_child(ChildWnd* child)
 	int idx;
 
 	get_path(child->left.cur, path);
-	_tsplitpath(path, drv, NULL, NULL, NULL);
+	_wsplitpath(path, drv, NULL, NULL, NULL);
 
 	child->right.root = NULL;
 
@@ -4017,7 +4017,7 @@ static BOOL prompt_target(Pane* pane, LPTSTR source, LPTSTR target)
 		TCHAR fname[_MAX_FNAME], ext[_MAX_EXT];
 		static const TCHAR sAppend[] = {'%','s','/','%','s','%','s','\0'};
 
-		_tsplitpath(source, NULL, NULL, fname, ext);
+		_wsplitpath(source, NULL, NULL, fname, ext);
 
 		wsprintf(target, sAppend, path, fname, ext);
 	}
@@ -4733,7 +4733,7 @@ static BOOL show_frame(HWND hwndParent, int cmdshow, LPCTSTR path)
 
 		memset(name,0,sizeof(name));
 		memset(name,0,sizeof(ext));
-		_tsplitpath(path, drv, dir, name, ext);
+		_wsplitpath(path, drv, dir, name, ext);
 		if (name[0])
 		{
 			count = SendMessage(child->right.hwnd, LB_GETCOUNT, 0, 0);
diff --git a/programs/winefile/winefile.h b/programs/winefile/winefile.h
index 98684c8..ac2b43c 100644
--- a/programs/winefile/winefile.h
+++ b/programs/winefile/winefile.h
@@ -145,13 +145,4 @@ typedef struct
 
 extern WINEFILE_GLOBALS Globals;
 
-#ifdef __WINE__
-
 extern void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext);
-#define _tsplitpath _wsplitpath
-
-#else
-
-#include <tchar.h>	/* for _tsplitpath() */
-
-#endif




More information about the wine-cvs mailing list