Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!usc!cs.utexas.edu!ti-csl!m2!ramey From: ramey@jello.csc.ti.com (Joe Ramey) Newsgroups: gnu.bash.bug Subject: Re: name globbing bug Message-ID: Date: 22 Nov 89 23:30:56 GMT References: Sender: news@ti-csl.csc.ti.com Distribution: gnu Organization: TI Computer Science Center, Dallas Lines: 46 In-reply-to: thewalt@RITZ.ce.cmu.edu's message of 21 Nov 89 13:31:56 GMT In article thewalt@RITZ.ce.cmu.edu (Chris Thewalt) writes: I seem to have found a file name globbing bug, whenever the string to be expanded starts with a / the / seems to be dissappearing in the attempted expansion. For example, if I am in directory /bin and do ls /t* I get tar tee test time tp true (in the current dir) instead of tmp tp (in /) [bash 1.04 on MicroVAX II running Ultrix 2.2] Chris -- I came up with this fix for the problem. Note that even with this fix bash still behaves differently than sh and csh. Try echo /tm* //tm* ///tm* and notice that one / is removed from the last two examples. *** glob.c.ORIG Fri Sep 22 23:35:45 1989 --- glob.c Tue Nov 14 10:17:14 1989 *************** *** 415,421 **** } else { ! directory_len = filename - pathname; directory_name = (char *) alloca (directory_len + 1); bcopy (pathname, directory_name, directory_len); directory_name[directory_len] = '\0'; --- 415,424 ---- } else { ! if (filename == pathname) ! directory_len = 1; ! else ! directory_len = filename - pathname; directory_name = (char *) alloca (directory_len + 1); bcopy (pathname, directory_name, directory_len); directory_name[directory_len] = '\0';