]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Add two more cases where wcscmp is needed. From Hauke Fath
authorJoerg Sonnenberger <joerg.sonnenberger@gmail.com>
Mon, 28 Jun 2010 21:31:24 +0000 (17:31 -0400)
committerJoerg Sonnenberger <joerg.sonnenberger@gmail.com>
Mon, 28 Jun 2010 21:31:24 +0000 (17:31 -0400)
SVN-Revision: 2511

cpio/test/main.c
tar/test/main.c

index a8b68146eb7af98eba767e0b77ffd19e70f77766..90336a9e630d0f9665f37e12605c17e811f0b081 100644 (file)
@@ -489,6 +489,22 @@ wcsdump(const char *e, const wchar_t *w)
        logprintf("\"\n");
 }
 
+#ifndef HAVE_WCSCMP
+static int
+wcscmp(const wchar_t *s1, const wchar_t *s2)
+{
+
+       while (*s1 == *s2++) {
+               if (*s1++ == L'\0')
+                       return 0;
+       }
+       if (*s1 > *--s2)
+               return 1;
+       else
+               return -1;
+}
+#endif
+
 /* Verify that two wide strings are equal, dump them if not. */
 int
 assertion_equal_wstring(const char *file, int line,
index 256f8abcc7cb1465599e6d283e9988b138b75d10..9c8c4e93c425b0e7c3b36c947526230c9800f140 100644 (file)
@@ -490,6 +490,22 @@ wcsdump(const char *e, const wchar_t *w)
        logprintf("\"\n");
 }
 
+#ifndef HAVE_WCSCMP
+static int
+wcscmp(const wchar_t *s1, const wchar_t *s2)
+{
+
+       while (*s1 == *s2++) {
+               if (*s1++ == L'\0')
+                       return 0;
+       }
+       if (*s1 > *--s2)
+               return 1;
+       else
+               return -1;
+}
+#endif
+
 /* Verify that two wide strings are equal, dump them if not. */
 int
 assertion_equal_wstring(const char *file, int line,