summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorErik Andersen2000-04-18 22:09:06 +0000
committerErik Andersen2000-04-18 22:09:06 +0000
commit632bb571357c4cef455c00fb06493810284e544d (patch)
tree21e52f13437307a0ca182125f6dc11715e16f8c4 /utility.c
parentc366050a23630f0763159263d62b3f1efa0c46ef (diff)
downloadbusybox-632bb571357c4cef455c00fb06493810284e544d.zip
busybox-632bb571357c4cef455c00fb06493810284e544d.tar.gz
Fix symlink following bug in chmod -R and friends. Allow SYSV style
'chown foo:bar' in addition to 'chown foo.bar', and fix a bug in the busybox globbing routine such that 'find /dir -name [i]' no longer segfaults. -Erik
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/utility.c b/utility.c
index 0045e4d..773f6a8 100644
--- a/utility.c
+++ b/utility.c
@@ -1058,6 +1058,7 @@ extern int check_wildcard_match(const char *text, const char *pattern)
const char *retryText;
int ch;
int found;
+ int len;
retryPat = NULL;
retryText = NULL;
@@ -1084,13 +1085,17 @@ extern int check_wildcard_match(const char *text, const char *pattern)
if (*text == ch)
found = TRUE;
}
- if (found == FALSE)
- continue;
+ len=strlen(text);
+ if (found == FALSE && len!=0) {
+ return FALSE;
+ }
if (found == TRUE) {
- //printf("Got a match. pattern='%s' text='%s'\n", pattern, text);
- if (retryPat || retryText) {
- pattern = retryPat;
- text = ++retryText;
+ if (strlen(pattern)==0 && len==1) {
+ return TRUE;
+ }
+ if (len!=0) {
+ text++;
+ continue;
}
}