--- sh.misc.c +++ sh.misc.c 2008-10-06 13:58:56.389867280 +0000 @@ -185,8 +185,18 @@ saveblk(Char **v) onewv = newv = xcalloc(blklen(v) + 1, sizeof(Char **)); - while (*v) - *newv++ = Strsave(*v++); + while (*v) { + Char *__restrict__ l = *v; + do { + int c; + if (!l || ((c = TRM(*l)) != ' ' && c != '\t' && c != '\n')) + break; /* strip blanks */ + l++; + } while (*l); + *newv++ = Strsave(l); + v++; + } + return (onewv); }