From: Joerg Sonnenberger Date: Mon, 28 Jun 2010 21:31:24 +0000 (-0400) Subject: Add two more cases where wcscmp is needed. From Hauke Fath X-Git-Tag: v3.0.0a~931 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f106ec929fd2d1adfd2c651afded53d3029f7db5;p=thirdparty%2Flibarchive.git Add two more cases where wcscmp is needed. From Hauke Fath SVN-Revision: 2511 --- diff --git a/cpio/test/main.c b/cpio/test/main.c index a8b68146e..90336a9e6 100644 --- a/cpio/test/main.c +++ b/cpio/test/main.c @@ -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, diff --git a/tar/test/main.c b/tar/test/main.c index 256f8abcc..9c8c4e93c 100644 --- a/tar/test/main.c +++ b/tar/test/main.c @@ -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,