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

SVN-Revision: 2512

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 6028d7789a4a7e33652daa8afca5856ad67289ba..4f8309e59c656dc58a2e1e9ff07f83fad91b2ec2 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,