summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorErik Andersen2000-04-18 21:18:57 +0000
committerErik Andersen2000-04-18 21:18:57 +0000
commitc366050a23630f0763159263d62b3f1efa0c46ef (patch)
treece8748eed3ec315986b81e3120ba7e7e5701297b /utility.c
parentf29f797f54451a6a5801b065a2896ea403334f4f (diff)
downloadbusybox-c366050a23630f0763159263d62b3f1efa0c46ef.zip
busybox-c366050a23630f0763159263d62b3f1efa0c46ef.tar.gz
Fix stupid bug (wrong variable)
-Erik
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/utility.c b/utility.c
index 29934cd..0045e4d 100644
--- a/utility.c
+++ b/utility.c
@@ -610,6 +610,7 @@ int recursiveAction(const char *fileName,
fprintf(stderr, name_too_long, "ftw");
return FALSE;
}
+ memset(nextFile, 0, sizeof(nextFile));
sprintf(nextFile, "%s/%s", fileName, next->d_name);
status =
recursiveAction(nextFile, TRUE, followLinks, depthFirst,
@@ -1083,11 +1084,14 @@ extern int check_wildcard_match(const char *text, const char *pattern)
if (*text == ch)
found = TRUE;
}
-
- //if (!found)
+ if (found == FALSE)
+ continue;
if (found == TRUE) {
- pattern = retryPat;
- text = ++retryText;
+ //printf("Got a match. pattern='%s' text='%s'\n", pattern, text);
+ if (retryPat || retryText) {
+ pattern = retryPat;
+ text = ++retryText;
+ }
}
/* fall into next case */
@@ -1378,7 +1382,7 @@ extern pid_t* findPidByName( char* pidName)
}
p=buffer+6; /* Skip the "Name:\t" */
- if (((q=strstr(q, pidName)) != NULL)
+ if (((q=strstr(p, pidName)) != NULL)
&& (strncmp(q, pidName, strlen(pidName)) != 0)) {
pidList=realloc( pidList, sizeof(pid_t) * (i+2));
if (pidList==NULL)