diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-29 10:31:31 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-29 10:31:31 +0000 |
commit | 7e5be7e1314cde91c2c05702eff3da8083925172 (patch) | |
tree | 4ba2629e28731f544c1fae9980ba5c6a308e64c7 | |
parent | 9bd616a3d3c2ca0b33afcfd56b20b936c70e0353 (diff) | |
download | ruby-7e5be7e1314cde91c2c05702eff3da8083925172.tar.gz |
* dir.c (char_casecmp): fix: return 0 if either of characters is NUL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | dir.c | 3 |
2 files changed, 5 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Tue Jul 29 17:54:35 2008 NARUSE, Yui <naruse@ruby-lang.org> + + * dir.c (char_casecmp): fix: return 0 if either of characters is NUL. + Tue Jul 29 13:17:03 2008 NARUSE, Yui <naruse@ruby-lang.org> * test/etc/test_etc.rb (test_getpwuid): fix for users whose uid is @@ -89,8 +89,7 @@ char_casecmp(const char *p1, const char *p2, rb_encoding *enc, const int nocase) 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); |