🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #554

Re: globbing bug

#554
From: Spencer Garrett
Date: Thu, 07 Sep 1989 18:16
18 lines
1504 bytes
In article <8909040114.AA21411@comp.vuw.ac.nz>, nickson@comp.vuw.ac.nz (Ray Nickson) writes:
->    The problem is (not surprisingly) in the glob_match function in
->    glob.c; when matching against *<something>, we try to see how much of
->    our text <something> matches, and make * match enough to make this
->    work.  So, we first attempt to match [^C] to BC; this fails because
->    [^C] must match exactly one character.  Matching [^C] to C fails,
->    because it cannot match a C.  But then, we try to match [^C] against
->    the null string; the code as written will test the first character of
->    the null string ('\0') against each element of the set (i.e. C); it
->    won't match, so we claim that "" matches [^C].
-> 
->    The easiest solution is probably to special-case the null string in
->    text being matched against a set, as we do when matching against ?.

Argh!  The code should remember where the end of the string is, and
not try to special case some magic character.  The comparison should
always fail if you're at the end of the string, but not at the end of
the pattern.
Technical Details
Message-ID: <5199@quick.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bbn!mit-eddie!uw-beaver!sumax!quick!srg
References: <8909040114.AA21411@comp.vuw.ac.nz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bbn!mit-eddie!uw-beaver!sumax!quick!srg
From: srg@quick.COM (Spencer Garrett)
Newsgroups: gnu.bash.bug
Subject: Re: globbing bug
Message-ID: <5199@quick.COM>
Date: 7 Sep 89 18:16:48 GMT
References: <8909040114.AA21411@comp.vuw.ac.nz>
Distribution: gnu
Organization: Quicksilver Engineering, Seattle
Lines: 18