* dir.c (glob_helper): preserve raw order for **.

Index: dir.c
===================================================================
RCS file: /cvs/ruby/src/ruby/dir.c,v
retrieving revision 1.86
diff -u -2 -p -r1.86 dir.c
--- dir.c	23 Jun 2003 08:41:07 -0000	1.86
+++ dir.c	18 Aug 2003 01:59:07 -0000
@@ -732,5 +732,5 @@ glob_helper(path, sub, flags, func, arg)
 		char *path;
 		struct d_link *next;
-	    } *tmp, *link = 0;
+	    } *tmp, *link, **tail = &link;
 
 	    base = extract_path(path, p);
@@ -809,10 +809,11 @@ 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);
