From 674a0c3559b6fdb25e021f003384ada6bd906890 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Thu, 28 Jan 2021 06:32:42 +0000 Subject: [PATCH] Another lexical fix for here-documents (re: 6e515f1d) OpenSUSE patch from: https://build.opensuse.org/package/view_file/shells/ksh/ksh93-heredoc.dif src/cmd/ksh93/sh/lex.c: here_copy(): - Do not potentially seek back a zero or negative length. --- src/cmd/ksh93/sh/lex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/ksh93/sh/lex.c b/src/cmd/ksh93/sh/lex.c index 90596e446..660878476 100644 --- a/src/cmd/ksh93/sh/lex.c +++ b/src/cmd/ksh93/sh/lex.c @@ -1891,6 +1891,8 @@ static int here_copy(Lex_t *lp,register struct ionod *iop) sfputc(sp,'\\'); } } + if(LEN < 1) + LEN = 1; bufp = fcseek(-LEN); } else