diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-02-01 11:09:13 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-02-01 11:09:13 +0200 |
commit | d3d60512bd1df6ed5027a9dedf1d1ab97f969ad6 (patch) | |
tree | 7485f746fe2950c7550f7abde17ddc902a2ee374 /rpmio | |
parent | fbc9b689fb7c30cabe51ec7b18bd692451249df1 (diff) | |
download | librpm-tizen-d3d60512bd1df6ed5027a9dedf1d1ab97f969ad6.tar.gz librpm-tizen-d3d60512bd1df6ed5027a9dedf1d1ab97f969ad6.tar.bz2 librpm-tizen-d3d60512bd1df6ed5027a9dedf1d1ab97f969ad6.zip |
Macro shell expansion fixes (rhbz#431009)
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/macro.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c index 040b5a184..cef68bd42 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -497,8 +497,11 @@ doShellEscape(MacroBuf mb, const char * cmd, size_t clen) if ((shf = popen(pcmd, "r")) == NULL) return 1; - while(mb->nb > 0 && (c = fgetc(shf)) != EOF) - SAVECHAR(mb, c); + while((c = fgetc(shf)) != EOF) { + if (mb->nb > 1) { + SAVECHAR(mb, c); + } + } (void) pclose(shf); /* XXX delete trailing \r \n */ |