Thread View: gnu.bash.bug
1 messages
1 total messages
Started by Ray Nickson
Thu, 16 Nov 1989 01:12
globbing bug in 1.04
Author: Ray Nickson
Date: Thu, 16 Nov 1989 01:12
Date: Thu, 16 Nov 1989 01:12
49 lines
1545 bytes
1545 bytes
[ The patches in the message about HPUX job control also apply to
1.04; sorry, forgot to say so. ]
Globbing doesn't work right:
bash$ ls
abc abd bbc cbc
bash$ echo *[^c]
abc abd bbc cbc
bash$
I understand that *[^c] should match any sequence of characters
followed by a single character which is not a c; only abd should have
matched. The problem is that [^c] is matching the null at the end of
each filename. The patch below seems to fix this.
-rgn
--
Ray Nickson, Dept. Comp. Sci., Victoria University of Wellington, New Zealand.
Ray.Nickson@comp.vuw.ac.nz + 64 4 721000x8593
*** glob.c.orig Sat Sep 23 16:35:45 1989
--- glob.c Wed Nov 15 16:16:54 1989
***************
*** 144,152 ****
case '[':
{
! register char c1 = *t++;
int invert;
invert = ((*p == '!') || (*p == '^'));
if (invert)
p++;
--- 145,157 ----
case '[':
{
! register char c1 = *t;
int invert;
+ if (*t++ == '\0')
+ return 0;
+
+
invert = ((*p == '!') || (*p == '^'));
if (invert)
p++;
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads