diff --git a/build/wince/shunt/mozce_internal.h b/build/wince/shunt/mozce_internal.h index 49d1eb4667a..da4452ae3f9 100755 --- a/build/wince/shunt/mozce_internal.h +++ b/build/wince/shunt/mozce_internal.h @@ -154,7 +154,7 @@ void dumpMemoryInfo(); extern "C" { #endif - MOZCE_SHUNT_API int mozce_printf(const char *, ...); + MOZCE_SHUNT_API int mozce_printf(const char *, ...); #ifdef __cplusplus }; diff --git a/build/wince/shunt/stdio.cpp b/build/wince/shunt/stdio.cpp index 0eba793224a..7febdaf760d 100755 --- a/build/wince/shunt/stdio.cpp +++ b/build/wince/shunt/stdio.cpp @@ -129,9 +129,17 @@ MOZCE_SHUNT_API char* mozce_getcwd(char* buff, size_t size) MOZCE_PRECHECK #ifdef DEBUG - mozce_printf("mozce_getcwd called. NOT IMPLEMENTED!!\n"); -#endif - return NULL; + mozce_printf("mozce_getcwd called.\n"); +#endif + + unsigned short dir[MAX_PATH]; + GetModuleFileName(GetModuleHandle (NULL), dir, MAX_PATH); + for (int i = _tcslen(dir); i && dir[i] != TEXT('\\'); i--) {} + dir[i + 1] = TCHAR('\0'); + + w2a_buffer(dir, -1, buff, size); + + return buff; } MOZCE_SHUNT_API int mozce_printf(const char * format, ...) diff --git a/build/wince/shunt/stdlib.cpp b/build/wince/shunt/stdlib.cpp index 9205f9addf2..602fbdd2064 100755 --- a/build/wince/shunt/stdlib.cpp +++ b/build/wince/shunt/stdlib.cpp @@ -55,10 +55,23 @@ MOZCE_SHUNT_API char *mozce_fullpath(char *absPath, const char *relPath, size_t #ifdef LOG_CALLS #ifdef DEBUG - mozce_printf("*mozce_fullpath called\n"); + mozce_printf("mozce_fullpath called\n"); #endif #endif - return 0; + + if (relPath[0] != '\\') + { + unsigned short dir[MAX_PATH]; + GetModuleFileName(GetModuleHandle (NULL), dir, MAX_PATH); + for (int i = _tcslen(dir); i && dir[i] != TEXT('\\'); i--) {} + + dir[i + 1] = TCHAR('\0'); + + w2a_buffer(dir, -1, absPath, maxLength); + } + strcat(absPath, relPath); + + return absPath; } MOZCE_SHUNT_API void mozce_splitpath(const char* inPath, char* outDrive, char* outDir, char* outFname, char* outExt)