Don't modify output that is to be quoted if it contains no IFS characters

or shell metacharacters.
This commit is contained in:
tjr 2002-06-06 03:29:23 +00:00
parent 616a2ae30e
commit d658a1e5c7

View File

@ -68,6 +68,7 @@ static const char rcsid[] =
#include "output.h"
#include "memalloc.h"
#include "error.h"
#include "var.h"
#define OUTBUFSIZ BUFSIZ
@ -140,6 +141,12 @@ outqstr(const char *p, struct output *file)
{
char ch;
if (p[strcspn(p, "|&;<>()$`\\\"'")] == '\0' && (!ifsset() ||
p[strcspn(p, ifsval())] == '\0')) {
outstr(p, file);
return;
}
out1c('\'');
while ((ch = *p++) != '\0') {
switch (ch) {