Blame rpm-4.5.90-macro-args.patch
|
Panu Matilainen |
9ba3bc |
diff --git a/rpmio/macro.c b/rpmio/macro.c
|
|
Panu Matilainen |
9ba3bc |
index ad1f94a..1e292c6 100644
|
|
Panu Matilainen |
9ba3bc |
--- a/rpmio/macro.c
|
|
Panu Matilainen |
9ba3bc |
+++ b/rpmio/macro.c
|
|
Panu Matilainen |
9ba3bc |
@@ -780,7 +780,7 @@ static const char *
|
|
Panu Matilainen |
9ba3bc |
grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
|
|
Panu Matilainen |
9ba3bc |
const char * lastc)
|
|
Panu Matilainen |
9ba3bc |
{
|
|
Panu Matilainen |
9ba3bc |
- const char *opts, *o, *ret;
|
|
Panu Matilainen |
9ba3bc |
+ const char *opts, *o;
|
|
Panu Matilainen |
9ba3bc |
char *args = NULL;
|
|
Panu Matilainen |
9ba3bc |
ARGV_t argv = NULL;
|
|
Panu Matilainen |
9ba3bc |
int argc = 0;
|
|
Panu Matilainen |
9ba3bc |
@@ -792,13 +792,10 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
|
|
Panu Matilainen |
9ba3bc |
|
|
Panu Matilainen |
9ba3bc |
/*
|
|
Panu Matilainen |
9ba3bc |
* Make a copy of se up to lastc string that we can pass to argvSplit().
|
|
Panu Matilainen |
9ba3bc |
- * Append the results to main argv, save return value.
|
|
Panu Matilainen |
9ba3bc |
+ * Append the results to main argv.
|
|
Panu Matilainen |
9ba3bc |
*/
|
|
Panu Matilainen |
9ba3bc |
{ ARGV_t av = NULL;
|
|
Panu Matilainen |
9ba3bc |
char *s = xcalloc((lastc-se)+1, sizeof(*s));
|
|
Panu Matilainen |
9ba3bc |
-
|
|
Panu Matilainen |
9ba3bc |
- /* XXX expandMacro() expects next \0 which can be beyond lastc */
|
|
Panu Matilainen |
9ba3bc |
- ret = strchr(se, '\0');
|
|
Panu Matilainen |
9ba3bc |
memcpy(s, se, (lastc-se));
|
|
Panu Matilainen |
9ba3bc |
|
|
Panu Matilainen |
9ba3bc |
argvSplit(&av, s, " ");
|
|
Panu Matilainen |
9ba3bc |
@@ -884,7 +881,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se,
|
|
Panu Matilainen |
9ba3bc |
|
|
Panu Matilainen |
9ba3bc |
exit:
|
|
Panu Matilainen |
9ba3bc |
argvFree(argv);
|
|
Panu Matilainen |
9ba3bc |
- return ret;
|
|
Panu Matilainen |
9ba3bc |
+ return *lastc ? lastc + 1 : lastc;
|
|
Panu Matilainen |
9ba3bc |
}
|
|
Panu Matilainen |
9ba3bc |
|
|
Panu Matilainen |
9ba3bc |
/**
|