Bug 461848 - libjar wince cleanup r+sr=dveditz
authorDoug Turner <dougt@meer.net>
Wed, 03 Dec 2008 08:41:12 -0500
changeset 22237 bbd7d4a7f52cb0024a7debbb61b5b26dee139673
parent 22236 ce8fbd7d222e0a07dc0d9d9585dfe532732830c3
child 22238 70097082a265b6d8311265dec169a374200496d3
push idunknown
push userunknown
push dateunknown
bugs461848
milestone1.9.2a1pre
Bug 461848 - libjar wince cleanup r+sr=dveditz
modules/libjar/nsZipArchive.cpp
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -98,16 +98,33 @@ char * strdup(const char *src)
 {
     long len = strlen(src);
     char *dup = (char *)malloc(len+1 * sizeof(char));
     memcpy(dup, src, len+1);
     return dup;
 }
 #endif
 
+#ifdef WINCE
+int remove(const char* inPath)
+{
+  unsigned short wPath[MAX_PATH];
+  MultiByteToWideChar(CP_ACP,
+                      0,
+                      inPath,
+                      -1,
+                      wPath,
+                      MAX_PATH);
+  
+  if(FALSE != DeleteFileW(wPath))
+    return 0;
+  return -1;
+}
+#endif
+
 #endif /* STANDALONE */
 
 #ifdef XP_UNIX
     #include <sys/types.h>
     #include <sys/stat.h>
     #include <limits.h>
     #include <unistd.h>
 #elif defined(XP_WIN) || defined(XP_OS2)