Skip to content

Commit

Permalink
Changed the non-globbing version of glob_expand_one() so that it
Browse files Browse the repository at this point in the history
checks the maxargs argument instead of leaving it unused.
  • Loading branch information
Wayne Davison committed May 8, 2004
1 parent 534407b commit 4135d09
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,10 @@ static int exclude_server_path(char *arg)
static void glob_expand_one(char *s, char **argv, int *argc, int maxargs)
{
#if !(defined(HAVE_GLOB) && defined(HAVE_GLOB_H))
if (!*s) s = ".";
if (maxargs <= *argc)
return;
if (!*s)
s = ".";
s = argv[*argc] = strdup(s);
exclude_server_path(s);
(*argc)++;
Expand All @@ -508,12 +511,12 @@ static void glob_expand_one(char *s, char **argv, int *argc, int maxargs)
glob_t globbuf;
int i;

if (!*s) s = ".";
if (!*s)
s = ".";

s = argv[*argc] = strdup(s);
if (sanitize_paths) {
if (sanitize_paths)
sanitize_path(s, NULL);
}

memset(&globbuf, 0, sizeof globbuf);
if (!exclude_server_path(s))
Expand Down

0 comments on commit 4135d09

Please sign in to comment.