[Scummvm-cvs-logs] SF.net SVN: scummvm:[39978] scummvm/branches/branch-0-13-0/backends/ platform/wince/missing/missing.cpp

knakos at users.sourceforge.net knakos at users.sourceforge.net
Sat Apr 18 11:53:10 CEST 2009


Revision: 39978
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39978&view=rev
Author:   knakos
Date:     2009-04-18 09:53:09 +0000 (Sat, 18 Apr 2009)

Log Message:
-----------
fix a regression for wince 3.0 devices. leave this as a workaround in the branch

Modified Paths:
--------------
    scummvm/branches/branch-0-13-0/backends/platform/wince/missing/missing.cpp

Modified: scummvm/branches/branch-0-13-0/backends/platform/wince/missing/missing.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/wince/missing/missing.cpp	2009-04-18 08:37:22 UTC (rev 39977)
+++ scummvm/branches/branch-0-13-0/backends/platform/wince/missing/missing.cpp	2009-04-18 09:53:09 UTC (rev 39978)
@@ -42,6 +42,7 @@
 #endif
 #include "time.h"
 #include "dirent.h"
+#include "common/util.h"
 
 char *strdup(const char *strSource);
 
@@ -182,11 +183,19 @@
 	HANDLE h = FindFirstFile(fname, &ffd);
 	FindClose(h);
 
-	if (h == INVALID_HANDLE_VALUE)
-		return -1;  //Can't find file
+	if (h == INVALID_HANDLE_VALUE) {
+		// WORKAROUND: WinCE 3.0 doesn't find paths ending in '\'
+		if (path[strlen(path)-1] == '\\') {
+			char p2[MAX_PATH];
+			strncpy(p2, path, strlen(path)-1);
+			p2[strlen(path) - 1]= '\0';
+			return _access(p2, mode);
+		} else
+			return -1;  //Can't find file
+	}
 
 	if (ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) {
-		// WORKAROUND: WinCE (or the emulator) sometimes returns bogus direcotry
+		// WORKAROUND: WinCE (or the emulator) sometimes returns bogus directory
 		// hits for files that don't exist. TRIPLE checking for the same fname
 		// seems to weed out those false positives.
 		// Exhibited in kyra engine.


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list