From: Joerg Sonnenberger Date: Mon, 28 Jun 2010 21:44:02 +0000 (-0400) Subject: Merge r2511: X-Git-Tag: v2.8.4~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=040d67b12019cfbebfdee0a7c05aa48f3282ae42;p=thirdparty%2Flibarchive.git Merge r2511: Add two more cases where wcscmp is needed. From Hauke Fath SVN-Revision: 2512 --- 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 6028d7789..4f8309e59 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,