shared/util: Fix glob_extend() argument

glob_extend() would completely fail to work, or return incorrect
data if it wasn't being passed the current getopt "optarg" variable
as it used the global variable, instead of the passed parameters.
This commit is contained in:
Bastien Nocera 2013-10-14 08:15:51 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 71fda00f32
commit a8ccacf534
Notes: Zbigniew Jędrzejewski-Szmek 2013-10-21 16:54:33 -04:00
Backport: bugfix

View File

@ -4461,7 +4461,7 @@ int glob_extend(char ***strv, const char *path) {
char **p;
errno = 0;
k = glob(optarg, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
k = glob(path, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
if (k == GLOB_NOMATCH)
return -ENOENT;