Now [^abc] means the same as [!abc] like bash and *csh already does

This commit is contained in:
Andrey A. Chernov 1997-06-06 23:04:33 +00:00
parent 05a068e60e
commit ea1376dfbb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26488

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: expand.c,v 1.17 1997/04/28 03:28:43 steve Exp $
* $Id: expand.c,v 1.18 1997/05/19 00:18:40 steve Exp $
*/
#ifndef lint
@ -1032,7 +1032,7 @@ expmeta(enddir, name)
metaflag = 1;
else if (*p == '[') {
q = p + 1;
if (*q == '!')
if (*q == '!' || *q == '^')
q++;
for (;;) {
if (*q == CTLESC)
@ -1267,7 +1267,7 @@ pmatch(pattern, string)
char chr;
endp = p;
if (*endp == '!')
if (*endp == '!' || *endp == '^')
endp++;
for (;;) {
if (*endp == '\0')
@ -1278,7 +1278,7 @@ pmatch(pattern, string)
break;
}
invert = 0;
if (*p == '!') {
if (*p == '!' || *p == '^') {
invert++;
p++;
}