summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-09-11 16:56:50 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-09-11 16:56:50 +0300
commit9f857078253981e02575bd8f097e50d925476d3b (patch)
tree68ec6af5b7e0316572c02ad803c31d3ee58e961a /rpmio
parent5c71ced2da7d99b870a07a83dd8f7e8d1f1b7e4b (diff)
downloadrpm-9f857078253981e02575bd8f097e50d925476d3b.tar.gz
rpm-9f857078253981e02575bd8f097e50d925476d3b.tar.bz2
rpm-9f857078253981e02575bd8f097e50d925476d3b.zip
Macro argument handling regression regression (rhbz#461180)
- commit f366011c42e4cf13d3acdd1af45127f0a1baec3a is too simplistic and broke other stuff in turn...
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/macro.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c
index ad1f94a44..1e292c6a2 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -780,7 +780,7 @@ static const char *
grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
const char * lastc)
{
- const char *opts, *o, *ret;
+ const char *opts, *o;
char *args = NULL;
ARGV_t argv = NULL;
int argc = 0;
@@ -792,13 +792,10 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
/*
* Make a copy of se up to lastc string that we can pass to argvSplit().
- * Append the results to main argv, save return value.
+ * Append the results to main argv.
*/
{ ARGV_t av = NULL;
char *s = xcalloc((lastc-se)+1, sizeof(*s));
-
- /* XXX expandMacro() expects next \0 which can be beyond lastc */
- ret = strchr(se, '\0');
memcpy(s, se, (lastc-se));
argvSplit(&av, s, " ");
@@ -884,7 +881,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
exit:
argvFree(argv);
- return ret;
+ return *lastc ? lastc + 1 : lastc;
}
/**