anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0080-shared-util-Fix-glob_extend-argument.patch

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