[Scummvm-cvs-logs] SF.net SVN: scummvm:[43115] scummvm/branches/branch-1-0-0/backends/platform /wince/missing/missing.cpp
knakos at users.sourceforge.net
knakos at users.sourceforge.net
Sat Aug 8 11:38:45 CEST 2009
Revision: 43115
http://scummvm.svn.sourceforge.net/scummvm/?rev=43115&view=rev
Author: knakos
Date: 2009-08-08 09:38:45 +0000 (Sat, 08 Aug 2009)
Log Message:
-----------
forward port of wince 3.0 fix for paths from branch 0.13.0, r39978 (backport to 1.0.0 branch)
Modified Paths:
--------------
scummvm/branches/branch-1-0-0/backends/platform/wince/missing/missing.cpp
Modified: scummvm/branches/branch-1-0-0/backends/platform/wince/missing/missing.cpp
===================================================================
--- scummvm/branches/branch-1-0-0/backends/platform/wince/missing/missing.cpp 2009-08-08 09:38:12 UTC (rev 43114)
+++ scummvm/branches/branch-1-0-0/backends/platform/wince/missing/missing.cpp 2009-08-08 09:38:45 UTC (rev 43115)
@@ -42,6 +42,7 @@
#endif
#include "time.h"
#include "dirent.h"
+#include "common/debug.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
+ if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+ // 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.
@@ -206,7 +215,7 @@
return 0;
case 06: //Check Read & Write permission
case 02: //Check Write permission
- return ffd.dwFileAttributes&FILE_ATTRIBUTE_READONLY?-1:0;
+ return ffd.dwFileAttributes & FILE_ATTRIBUTE_READONLY ? -1 : 0;
case 04: //Check Read permission
return 0; //Assume always have read permission
}
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