- Timestamp:
- Apr 7, 2007, 1:59:21 AM (18 years ago)
- Location:
- trunk/libc
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/src/libc/locale/locale_collate.c
r2717 r3002 33 33 { 34 34 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 35 10, 11, 1 3, 12, 14, 15, 16, 17, 18, 19,36 20, 21, 2 3, 22, 24, 25, 26, 27, 28, 29,37 30, 31, 3 3, 32, 34, 35, 36, 37, 38, 39,38 40, 41, 4 3, 42, 44, 45, 46, 47, 48, 49,39 50, 51, 5 3, 52, 54, 55, 56, 57, 58, 59,40 60, 61, 6 3, 62, 64, 65, 66, 67, 68, 69,41 70, 71, 7 3, 72, 74, 75, 76, 77, 78, 79,42 80, 81, 8 3, 82, 84, 85, 86, 87, 88, 89,43 90, 91, 9 3, 92, 94, 95, 96, 97, 98, 99,44 100, 101, 10 3, 102, 104, 105, 106, 107, 108, 109,45 110, 111, 11 3, 112, 114, 115, 116, 117, 118, 119,46 120, 121, 12 3, 122, 124, 125, 126, 127, 128, 129,47 130, 131, 13 3, 132, 134, 135, 136, 137, 138, 139,48 140, 141, 14 3, 142, 144, 145, 146, 147, 148, 149,49 150, 151, 15 3, 152, 154, 155, 156, 157, 158, 159,50 160, 161, 16 3, 162, 164, 165, 166, 167, 168, 169,51 170, 171, 17 3, 172, 174, 175, 176, 177, 178, 179,52 180, 181, 18 3, 182, 184, 185, 186, 187, 188, 189,53 190, 191, 19 3, 192, 194, 195, 196, 197, 198, 199,54 200, 201, 20 3, 202, 204, 205, 206, 207, 208, 209,55 210, 211, 21 3, 212, 214, 215, 216, 217, 218, 219,56 220, 221, 22 3, 222, 224, 225, 226, 227, 228, 229,57 230, 231, 23 3, 232, 234, 235, 236, 237, 238, 239,58 240, 241, 24 3, 242, 244, 245, 246, 247, 248, 249,59 250, 251, 25 3, 252, 254, 25535 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 36 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 37 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 38 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 39 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 40 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 41 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 42 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 43 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 44 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 45 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 46 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 47 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 48 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 49 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 50 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 51 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 52 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 53 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 54 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 55 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 56 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 57 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 58 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 59 250, 251, 252, 253, 254, 255 60 60 }, 61 61 .au2MBCSPrefixs = -
trunk/libc/src/libc/str/strcoll.c
r2717 r3002 31 31 if (__libc_gLocaleCollate.mbcs) 32 32 { 33 FS_VAR();34 FS_SAVE_LOAD();35 33 /* MBCS case. We compare the strings as usual, but as soon as we 36 34 encounter a MBCS character we translate the rests of the strings … … 45 43 UniChar *ucs [2]; 46 44 const char *sbcs [2] = { s1, s2 }; 45 FS_VAR_SAVE_LOAD(); 47 46 48 47 /* I can't imagine X bytes to convert into more … … 55 54 UniChar *outbuf = ucs [i] = alloca (sl * sizeof (UniChar)); 56 55 57 if (UniUconvToUcs (__libc_gLocaleCollate.uobj, &inbuf, &in_left, &outbuf, 58 &out_left, &nonid)) 56 if (UniUconvToUcs (__libc_gLocaleCollate.uobj, &inbuf, &in_left, &outbuf, &out_left, &nonid)) 59 57 { 60 58 /* Oops, something bad happened (invalid character code). Suppose … … 72 70 #endif 73 71 74 d = __libc_gLocaleCollate.auchWeight [c1] - __libc_gLocaleCollate.auchWeight [c2]; 75 if (d || !c1 || !c2) 72 if (c1 != c2) 76 73 { 77 FS_RESTORE(); 78 return d; 74 d = __libc_gLocaleCollate.auchWeight [c1] - __libc_gLocaleCollate.auchWeight [c2]; 75 if (d || !c1 || !c2) 76 return d; 79 77 } 78 else if (!c1) 79 return 0; 80 80 c1 = *++s1; 81 81 c2 = *++s2; 82 82 } /* endfor */ 83 FS_RESTORE();84 83 } 85 84 else … … 87 86 for (;;) 88 87 { 89 d = __libc_gLocaleCollate.auchWeight [c1] - __libc_gLocaleCollate.auchWeight [c2]; 90 if (d || !c1 || !c2) 91 return d; 88 if (c1 != c2) 89 { 90 d = __libc_gLocaleCollate.auchWeight [c1] - __libc_gLocaleCollate.auchWeight [c2]; 91 if (d || !c1 || !c2) 92 return d; 93 } 94 else if (!c1) 95 return 0; 92 96 c1 = *++s1; 93 97 c2 = *++s2; -
trunk/libc/tests/libc/Makefile
r2810 r3002 81 81 smoketests/spm-1.c \ 82 82 smoketests/stat-1.c \ 83 smoketests/strcoll-1.c \ 83 84 smoketests/strnlen-1.c \ 84 85 smoketests/strtof-1.c \
Note:
See TracChangeset
for help on using the changeset viewer.