Guest User

Untitled

a guest
Oct 22nd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. Index: tango/text/locale/Posix.d
  2. ===================================================================
  3. --- tango/text/locale/Posix.d (revision 5676)
  4. +++ tango/text/locale/Posix.d (working copy)
  5. @@ -118,14 +118,14 @@
  6. setlocale(LC_COLLATE, locale.ptr);
  7. setlocale(LC_CTYPE, locale.ptr);
  8.  
  9. - char[] s1 = stringA[offsetA..offsetA+lengthA].dup,
  10. - s2 = stringB[offsetB..offsetB+lengthB].dup;
  11. + char[] s1 = stringA[offsetA..offsetA+lengthA] ~ "\0",
  12. + s2 = stringB[offsetB..offsetB+lengthB] ~ "\0";
  13. if(ignoreCase) {
  14. strToLower(s1);
  15. strToLower(s2);
  16. }
  17.  
  18. - int ret = strcoll(s1[offsetA..offsetA+lengthA].ptr, s2[offsetB..offsetB+lengthB].ptr);
  19. + int ret = strcoll(s1.ptr, s2.ptr);
  20.  
  21. setlocale(LC_COLLATE, tempCol);
  22. setlocale(LC_CTYPE, tempCType);
  23. @@ -143,6 +143,7 @@
  24. assert(compareString(c, "Alphabet", 0, 8, "alphabet", 0, 8, false) != 0);
  25. assert(compareString(c, "lphabet", 0, 7, "alphabet", 0, 8, true) != 0);
  26. assert(compareString(c, "Alphabet", 0, 8, "lphabet", 0, 7, true) != 0);
  27. + assert(compareString(c, "Alphabet", 0, 7, "ZAlphabet", 1, 7, false) == 0);
  28. }
  29. }
  30. }
Add Comment
Please, Sign In to add comment