From 81daadfce8d5a6aec93c248e4428794a727e1069 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sun, 11 Nov 2007 14:21:23 +0800 Subject: [PARSER] Removed noexpand/length check on eofmark On Tue, Oct 30, 2007 at 04:23:35AM +0000, Oleg Verych wrote: > > } 8<<"" > ====================== Actually this (the empty delim) only works with dash by accident. I've tried bash and pdksh and they both terminate on the first empty line which is what you would expect rather than EOF. The real Korn shell does something completely different. I've fixed this in dash to conform to bash/pdksh. > In [0] it's stated, that delimiter isn't evaluated (expanded), only > quoiting must be checked. That if() seems to be completely bogus. OK I agree. The reason it was there is because the parser would have already replaced the dollar sign by an internal representation. I've fixed it properly with this patch. Test case: cat <<- $a OK $a cat <<- "" OK echo OK Old result: dash: Syntax error: Illegal eof marker for << redirection OK echo OK New result: OK OK OK --- src/input.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'src/input.c') diff --git a/src/input.c b/src/input.c index 11f7a3f..bc84e57 100644 --- a/src/input.c +++ b/src/input.c @@ -124,33 +124,6 @@ RESET { #endif -/* - * Read a line from the script. - */ - -char * -pfgets(char *line, int len) -{ - char *p = line; - int nleft = len; - int c; - - while (--nleft > 0) { - c = pgetc2(); - if (c == PEOF) { - if (p == line) - return NULL; - break; - } - *p++ = c; - if (c == '\n') - break; - } - *p = '\0'; - return line; -} - - /* * Read a character from the script, returning PEOF on end of file. * Nul characters in the input are silently discarded. -- cgit 1.4.1 ='573bc855a68766f38de2acb48bebc9d0adbf0a1f'/>
path: root/handle.c (unfollow)
Commit message (Expand)Author
2022-02-18Fix M-f orderingJune McEnroe
2022-02-12Move sandman build to scripts/MakefileJune McEnroe
2022-02-12Use compat_readpassphrase.c on LinuxJune McEnroe
2022-02-12Copy RPP defines from oconfigureJune McEnroe-22Add WIP serif8x16.psfJune McEnroe
2019-01-21Save cash history incrementallyJune McEnroe
Still needs better error and edge case handling, but seems to work.
2019-01-19Remove pingbotJune McEnroe