aboutsummaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorerik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-04-18 22:09:06 +0000
committererik <erik@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-04-18 22:09:06 +0000
commit7b2831108d762a87860a91c87959a3d04b1c3ed6 (patch)
tree21e52f13437307a0ca182125f6dc11715e16f8c4 /utility.c
parenta003628d0345f6a4f45da059e760c4a0bcc17fd4 (diff)
downloadbusybox-w32-7b2831108d762a87860a91c87959a3d04b1c3ed6.tar.gz
busybox-w32-7b2831108d762a87860a91c87959a3d04b1c3ed6.tar.bz2
busybox-w32-7b2831108d762a87860a91c87959a3d04b1c3ed6.zip
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 git-svn-id: svn://busybox.net/trunk/busybox@478 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r--utility.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/utility.c b/utility.c
index 0045e4d75..773f6a83e 100644
--- a/utility.c
+++ b/utility.c
@@ -1058,6 +1058,7 @@ extern int check_wildcard_match(const char *text, const char *pattern)
1058 const char *retryText; 1058 const char *retryText;
1059 int ch; 1059 int ch;
1060 int found; 1060 int found;
1061 int len;
1061 1062
1062 retryPat = NULL; 1063 retryPat = NULL;
1063 retryText = NULL; 1064 retryText = NULL;
@@ -1084,13 +1085,17 @@ extern int check_wildcard_match(const char *text, const char *pattern)
1084 if (*text == ch) 1085 if (*text == ch)
1085 found = TRUE; 1086 found = TRUE;
1086 } 1087 }
1087 if (found == FALSE) 1088 len=strlen(text);
1088 continue; 1089 if (found == FALSE && len!=0) {
1090 return FALSE;
1091 }
1089 if (found == TRUE) { 1092 if (found == TRUE) {
1090 //printf("Got a match. pattern='%s' text='%s'\n", pattern, text); 1093 if (strlen(pattern)==0 && len==1) {
1091 if (retryPat || retryText) { 1094 return TRUE;
1092 pattern = retryPat; 1095 }
1093 text = ++retryText; 1096 if (len!=0) {
1097 text++;
1098 continue;
1094 } 1099 }
1095 } 1100 }
1096 1101