ruby-changes:6741
From: naruse <ko1@a...>
Date: Tue, 29 Jul 2008 19:31:44 +0900 (JST)
Subject: [ruby-changes:6741] Ruby:r18257 (trunk): * dir.c (char_casecmp): fix: return 0 if either of characters is NUL.
naruse 2008-07-29 19:31:31 +0900 (Tue, 29 Jul 2008) New Revision: 18257 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18257 Log: * dir.c (char_casecmp): fix: return 0 if either of characters is NUL. Modified files: trunk/ChangeLog trunk/dir.c Index: ChangeLog =================================================================== --- ChangeLog (revision 18256) +++ ChangeLog (revision 18257) @@ -1,3 +1,7 @@ +Tue Jul 29 17:54:35 2008 NARUSE, Yui <naruse@r...> + + * dir.c (char_casecmp): fix: return 0 if either of characters is NUL. + Tue Jul 29 13:17:03 2008 NARUSE, Yui <naruse@r...> * test/etc/test_etc.rb (test_getpwuid): fix for users whose uid is Index: dir.c =================================================================== --- dir.c (revision 18256) +++ dir.c (revision 18257) @@ -89,8 +89,7 @@ const char *p1end, *p2end; int c1, c2; - if (!*p1) return *p1; - if (!*p2) return -*p2; + if (!*p1 || !*p2) return !!*p1 - !!*p2; p1end = p1 + strlen(p1); p2end = p2 + strlen(p2); c1 = rb_enc_codepoint(p1, p1end, enc); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/