[systemd-devel] [PATCH] shared/util: Fix glob_extend() argument

Bastien Nocera hadess at hadess.net
Sun Oct 13 23:15:51 PDT 2013


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.
---
 src/shared/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/shared/util.c b/src/shared/util.c
index 31cea79..e0da5b4 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -4387,7 +4387,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;
-- 
1.8.3.1




More information about the systemd-devel mailing list