diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-18 02:23:13 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-18 02:23:13 +0000 |
commit | 43e4a5001542c4d823334a83195600b5c2e7df26 (patch) | |
tree | 588d080db9a798dfaed1cae5ffd8184e932699cc /dir.c | |
parent | c7b5c0489b472b92f297e7ff64a10ee03523f570 (diff) | |
download | ruby-43e4a5001542c4d823334a83195600b5c2e7df26.tar.gz |
* dir.c (glob_helper): preserve raw order for **.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'dir.c')
-rw-r--r-- | dir.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -731,7 +731,7 @@ glob_helper(path, sub, flags, func, arg) struct d_link { char *path; struct d_link *next; - } *tmp, *link = 0; + } *tmp, *link, **tail = &link; base = extract_path(path, p); if (path == p) dir = "."; @@ -808,12 +808,13 @@ glob_helper(path, sub, flags, func, arg) } tmp = ALLOC(struct d_link); tmp->path = buf; - tmp->next = link; - link = tmp; + *tail = tmp; + tail = &tmp->next; } } closedir(dirp); finalize: + *tail = 0; free(base); free(magic); if (link) { |