Commit c8933031 authored by Wayne Davison's avatar Wayne Davison

Moved a variable in glob_expand_one().

parent c9dc1300
......@@ -528,7 +528,6 @@ static void glob_expand_one(char *s, char ***argv_ptr, int *argc_ptr,
filter_server_path(s);
#else
glob_t globbuf;
int i;
if (maxargs <= argc)
return;
......@@ -553,9 +552,9 @@ static void glob_expand_one(char *s, char ***argv_ptr, int *argc_ptr,
if (globbuf.gl_pathc == 0)
argv[argc++] = s;
else {
int j = globbuf.gl_pathc;
int i;
free(s);
for (i = 0; i < j; i++) {
for (i = 0; i < (int)globbuf.gl_pathc; i++) {
if (!(argv[argc++] = strdup(globbuf.gl_pathv[i])))
out_of_memory("glob_expand_one");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment