~mdw
/
become
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug in password and group file reading: strtok doesn't handle
[become]
/
src
/
class.c
diff --git
a/src/class.c
b/src/class.c
index
49b1341
..
31d6de6
100644
(file)
--- a/
src/class.c
+++ b/
src/class.c
@@
-1,10
+1,10
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: class.c,v 1.
6 1997/09/17 10:14:5
6 mdw Exp $
+ * $Id: class.c,v 1.
8 1998/06/08 11:20:3
6 mdw Exp $
*
* Handling classes of things nicely
*
*
* Handling classes of things nicely
*
- * (c) 199
7
EBI
+ * (c) 199
8
EBI
*/
/*----- Licensing notice --------------------------------------------------*
*/
/*----- Licensing notice --------------------------------------------------*
@@
-29,7
+29,14
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: class.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: class.c,v $
- * Revision 1.6 1997/09/17 10:14:56 mdw
+ * Revision 1.8 1998/06/08 11:20:36 mdw
+ * (class__wildMatch) Fixed bug which overran pattern string, spotted by
+ * Mark Rison.
+ *
+ * Revision 1.7 1998/01/12 16:45:50 mdw
+ * Fix copyright date.
+ *
+ * Revision 1.6 1997/09/17 10:14:56 mdw
* Complete rewrite to support class trees. Makes the behaviour of the set
* operators much more logical.
*
* Complete rewrite to support class trees. Makes the behaviour of the set
* operators much more logical.
*
@@
-102,12
+109,14
@@
static int class__wildMatch(const char *pat, const char *p)
else if (*pat == '*') {
while (*pat == '*')
pat++;
else if (*pat == '*') {
while (*pat == '*')
pat++;
+ if (!*pat)
+ return (58);
do {
if (class__wildMatch(pat, p))
return (27); /* Nyahaha */
p++;
} while (*p);
do {
if (class__wildMatch(pat, p))
return (27); /* Nyahaha */
p++;
} while (*p);
- return (
pat[1] ==
0);
+ return (0);
} else if (*pat == '?' || *pat == *p)
p++, pat++;
else
} else if (*pat == '?' || *pat == *p)
p++, pat++;
else