aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorKostas Nakos2008-12-28 20:19:22 +0000
committerKostas Nakos2008-12-28 20:19:22 +0000
commitfccaa73ae730b52193d84818f90ad4af1b76069f (patch)
treef84ec8d4f87ce359f1ac574a2183cda4f83e0e1f /backends/platform
parentec09d76b18353155b49d30d4b3f1b47c3ac5cc87 (diff)
downloadscummvm-rg350-fccaa73ae730b52193d84818f90ad4af1b76069f.tar.gz
scummvm-rg350-fccaa73ae730b52193d84818f90ad4af1b76069f.tar.bz2
scummvm-rg350-fccaa73ae730b52193d84818f90ad4af1b76069f.zip
workaround for ce's limitation of cwd in _access too
svn-id: r35594
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/wince/missing/missing.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp
index f03f00bb9a..5f122e0c54 100644
--- a/backends/platform/wince/missing/missing.cpp
+++ b/backends/platform/wince/missing/missing.cpp
@@ -150,8 +150,8 @@ EXT_C FILE *wce_fopen(const char* fname, const char* fmode) {
return NULL;
if (fname[0] != '\\' && fname[0] != '/') {
getcwd(fullname, MAX_PATH);
- strncat(fullname, "\\", MAX_PATH-strlen(fullname)-1);
- strncat(fullname, fname, MAX_PATH-strlen(fullname)-strlen(fname));
+ strcat(fullname, "\\");
+ strcat(fullname, fname);
return fopen(fullname, fmode);
} else
return fopen(fname, fmode);
@@ -168,7 +168,15 @@ int remove(const char* path) {
/* check out file access permissions */
int _access(const char *path, int mode) {
TCHAR fname[MAX_PATH];
- MultiByteToWideChar(CP_ACP, 0, path, -1, fname, sizeof(fname)/sizeof(TCHAR));
+ char fullname[MAX_PATH+1];
+
+ if (path[0] != '\\' && path[0] != '/') {
+ getcwd(fullname, MAX_PATH);
+ strcat(fullname, "\\");
+ strcat(fullname, path);
+ MultiByteToWideChar(CP_ACP, 0, fullname, -1, fname, sizeof(fname)/sizeof(TCHAR));
+ } else
+ MultiByteToWideChar(CP_ACP, 0, path, -1, fname, sizeof(fname)/sizeof(TCHAR));
WIN32_FIND_DATA ffd;
HANDLE h = FindFirstFile(fname, &ffd);