richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
9fc0f6
From 18f14dc669bfda1131e31f9818eabd962bda631d Mon Sep 17 00:00:00 2001
9fc0f6
From: Bastien Nocera <hadess@hadess.net>
9fc0f6
Date: Mon, 14 Oct 2013 08:15:51 +0200
9fc0f6
Subject: [PATCH] shared/util: Fix glob_extend() argument
9fc0f6
9fc0f6
glob_extend() would completely fail to work, or return incorrect
9fc0f6
data if it wasn't being passed the current getopt "optarg" variable
9fc0f6
as it used the global variable, instead of the passed parameters.
9fc0f6
---
9fc0f6
 src/shared/util.c | 2 +-
9fc0f6
 1 file changed, 1 insertion(+), 1 deletion(-)
9fc0f6
9fc0f6
diff --git a/src/shared/util.c b/src/shared/util.c
9fc0f6
index 9be6acf..48adc83 100644
9fc0f6
--- a/src/shared/util.c
9fc0f6
+++ b/src/shared/util.c
9fc0f6
@@ -4391,7 +4391,7 @@ int glob_extend(char ***strv, const char *path) {
9fc0f6
         char **p;
9fc0f6
 
9fc0f6
         errno = 0;
9fc0f6
-        k = glob(optarg, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
9fc0f6
+        k = glob(path, GLOB_NOSORT|GLOB_BRACE, NULL, &g);
9fc0f6
 
9fc0f6
         if (k == GLOB_NOMATCH)
9fc0f6
                 return -ENOENT;