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, ...@@ -528,7 +528,6 @@ static void glob_expand_one(char *s, char ***argv_ptr, int *argc_ptr,
filter_server_path(s); filter_server_path(s);
#else #else
glob_t globbuf; glob_t globbuf;
int i;
if (maxargs <= argc) if (maxargs <= argc)
return; return;
...@@ -553,9 +552,9 @@ static void glob_expand_one(char *s, char ***argv_ptr, int *argc_ptr, ...@@ -553,9 +552,9 @@ static void glob_expand_one(char *s, char ***argv_ptr, int *argc_ptr,
if (globbuf.gl_pathc == 0) if (globbuf.gl_pathc == 0)
argv[argc++] = s; argv[argc++] = s;
else { else {
int j = globbuf.gl_pathc; int i;
free(s); 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]))) if (!(argv[argc++] = strdup(globbuf.gl_pathv[i])))
out_of_memory("glob_expand_one"); 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