From 87e29e40db6e0743c54fbfc07f30397682e81a59 Mon Sep 17 00:00:00 2001 From: ocean Date: Thu, 6 May 2004 05:42:48 +0000 Subject: * dir.c (rb_push_glob): simplified code (not change behavior) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ dir.c | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b51d13742..ec1ef5ec5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu May 6 14:38:02 Hirokazu Yamamoto + + * dir.c (rb_push_glob): simplified code (not change behavior) + Thu May 6 13:32:44 2004 Nobuyoshi Nakada * ext/extmk.rb: get rid of side effect of Config.expand, patched by diff --git a/dir.c b/dir.c index 3f2552c33..754d19f23 100644 --- a/dir.c +++ b/dir.c @@ -1467,12 +1467,12 @@ rb_push_glob(str, flags) /* '\0' is delimiter */ pend = p + RSTRING(str)->len; while (p < pend) { - int status; - while (p < pend && *p == '\0') p++; - if (p == pend) break; - status = push_glob(ary, p, flags); - if (status) rb_jump_tag(status); - while (p < pend && *p != '\0') p++; + if (*p) { + int status = push_glob(ary, p, flags); + if (status) rb_jump_tag(status); + p += strlen(p); + } + else p++; } return ary; -- cgit