summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--dir.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a3c5cd0b8e..a50c345296 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Aug 18 11:23:11 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * dir.c (glob_helper): preserve raw order for **.
+
Sun Aug 17 23:39:55 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/openssl/extconf.rb (HAVE_VA_ARGS_MACRO): need to compile.
diff --git a/dir.c b/dir.c
index 7a188cacbb..b31096f515 100644
--- a/dir.c
+++ b/dir.c
@@ -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) {