summaryrefslogtreecommitdiff
path: root/posix/tst-fnmatch.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-03-15 09:36:19 +0000
committerUlrich Drepper <drepper@redhat.com>2001-03-15 09:36:19 +0000
commit955994e1313ab81c1db2a456b5fdf7cacb016366 (patch)
treee0366bf2c5c94172d932cfa3657d74418f005173 /posix/tst-fnmatch.c
parent0493a6d7e82806fc183a3c0b383fb95d3188b690 (diff)
Update.
2001-03-15 Ulrich Drepper <drepper@redhat.com> * posix/fnmatch.h (FNM_EXTMATCH): Define. * posix/fnmatch.c (NO_LEADING_PERIOD): Define. (posixly_correct): Move global variable here. (INT, EXT, END): Name new functions defined in fnmatch_loop.c. (fnmatch): Pretty printing. * posix/fnmatch_loop.c: Add code to handle FNM_EXTMATCH. * posix/tst-fnmatch.c: Recognize EXTMATCH flag. * posix/tst-fnmatch.input: Add tests for extended matching. * posix/testfnm.c: Add test for patterns with multiple ** before /. * posix/fnmatch_loop.c: Fix problem with the test above.
Diffstat (limited to 'posix/tst-fnmatch.c')
-rw-r--r--posix/tst-fnmatch.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/posix/tst-fnmatch.c b/posix/tst-fnmatch.c
index 719361519c..eee50c6424 100644
--- a/posix/tst-fnmatch.c
+++ b/posix/tst-fnmatch.c
@@ -1,5 +1,5 @@
/* Tests for fnmatch function.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -263,6 +263,12 @@ convert_flags (const char *str)
result |= FNM_CASEFOLD;
len = 8;
}
+ else if (strncasecmp (str, "EXTMATCH", 8) == 0
+ && (str[8] == '|' || str[8] == '\0'))
+ {
+ result |= FNM_EXTMATCH;
+ len = 8;
+ }
else
return -1;
@@ -315,6 +321,13 @@ flag_output (int flags)
cp = stpcpy (cp, "FNM_CASEFOLD");
first = 0;
}
+ if (flags & FNM_EXTMATCH)
+ {
+ if (! first)
+ *cp++ = '|';
+ cp = stpcpy (cp, "FNM_EXTMATCH");
+ first = 0;
+ }
if (cp == buf)
*cp++ = '0';
*cp = '\0';