Macro shell expansion fixes (rhbz#431009)

This commit is contained in:
Panu Matilainen 2008-02-01 11:09:13 +02:00
parent fbc9b689fb
commit d3d60512bd
1 changed files with 5 additions and 2 deletions

View File

@ -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)
while((c = fgetc(shf)) != EOF) {
if (mb->nb > 1) {
SAVECHAR(mb, c);
}
}
(void) pclose(shf);
/* XXX delete trailing \r \n */