source: branches/libc-0.6/src/libctests/glibc/string/bug-strcoll1.c

Last change on this file was 2036, checked in by bird, 20 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 535 bytes
Line 
1#include <stdio.h>
2#include <string.h>
3#include <locale.h>
4
5int
6main (void)
7{
8 const char t1[] = "0-0-0-0-0-0-0-0-0-0.COM";
9 const char t2[] = "00000-00000.COM";
10 int res1;
11 int res2;
12
13 setlocale (LC_ALL, "en_US.ISO-8859-1");
14
15 res1 = strcoll (t1, t2);
16 printf ("strcoll (\"%s\", \"%s\") = %d\n", t1, t2, res1);
17 res2 = strcoll (t2, t1);
18 printf ("strcoll (\"%s\", \"%s\") = %d\n", t2, t1, res2);
19
20 return ((res1 == 0 && res2 != 0)
21 || (res1 != 0 && res2 == 0)
22 || (res1 < 0 && res2 < 0)
23 || (res1 > 0 && res2 > 0));
24}
Note: See TracBrowser for help on using the repository browser.