ksh/ksh93-heredoc.dif
2012-01-20 17:45:26 +00:00

25 lines
592 B
Plaintext

--- src/cmd/ksh93/sh/lex.c
+++ src/cmd/ksh93/sh/lex.c 2012-01-16 16:09:37.624771155 +0100
@@ -1563,8 +1563,10 @@ static int comsub(register Lex_t *lp, in
if(endtok==LPAREN && lp->lexd.paren)
{
- if(first==lp->lexd.first)
- fcseek(cp+1-(char*)fcseek(0));
+ if(first==lp->lexd.first) {
+ const char *tp = (const char*)fcseek(0);
+ fcseek(cp+1-tp);
+ }
count++;
lp->lexd.paren = 0;
fcgetc(c);
@@ -1872,6 +1874,8 @@ static int here_copy(Lex_t *lp,register
sfputc(sp,'\\');
}
}
+ if (LEN < 1)
+ LEN = 1;
bufp = fcseek(-LEN);
}
else