]> wimlib.net Git - wimlib/blobdiff - src/wim.c
Win32: Improve restoring of special attributes
[wimlib] / src / wim.c
index 67b840cea209dcf68b0281164e2ff77fc75766a1..6859d5c7d50fd9d9fe607da5e53540225e4ba19d 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -255,7 +255,7 @@ WIMLIBAPI int
 wimlib_resolve_image(WIMStruct *w, const tchar *image_name_or_num)
 {
        tchar *p;
-       int image;
+       long image;
        int i;
 
        if (!image_name_or_num || !*image_name_or_num)
@@ -271,8 +271,8 @@ wimlib_resolve_image(WIMStruct *w, const tchar *image_name_or_num)
                return image;
        } else {
                for (i = 1; i <= w->hdr.image_count; i++) {
-                       if (tstrcmp(image_name_or_num,
-                                   wimlib_get_image_name(w, i)) == 0)
+                       if (!tstrcmp(image_name_or_num,
+                                    wimlib_get_image_name(w, i)))
                                return i;
                }
                return WIMLIB_NO_IMAGE;
@@ -596,15 +596,19 @@ wimlib_free(WIMStruct *w)
 static bool
 test_locale_ctype_utf8()
 {
+#ifdef __WIN32__
+       return false;
+#else
        char *ctype = nl_langinfo(CODESET);
 
        return (!strstr(ctype, "UTF-8") ||
                !strstr(ctype, "UTF8") ||
                !strstr(ctype, "utf8") ||
                !strstr(ctype, "utf-8"));
+#endif
 }
 
-/* Get global memory allocations out of the way, 
+/* Get global memory allocations out of the way,
  * single-threaded programs like 'imagex'. */
 WIMLIBAPI int
 wimlib_global_init()