[klibc] [klibc:update-dash] dash: [PARSER] Removed unnecessary pungetc on EOF from parser

klibc-bot for Herbert Xu herbert at gondor.apana.org.au
Sat Mar 28 14:48:32 PDT 2020

Commit-ID:  1e4af96f419af543624e38676fecd88c6691883d
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=1e4af96f419af543624e38676fecd88c6691883d
Author:     Herbert Xu <herbert at gondor.apana.org.au>
AuthorDate: Tue, 28 Oct 2014 10:32:03 +0800
Committer:  Ben Hutchings <ben at decadent.org.uk>
CommitDate: Sat, 28 Mar 2020 21:42:54 +0000

[klibc] dash: [PARSER] Removed unnecessary pungetc on EOF from parser

[ dash commit a31c812b02d7fc331f8a0c5aedbbf12b4025c1db ]

Doing a pungetc on an EOF is a noop and is only useful when we
don't know what character we're putting back.  This patch removes
an unnecessary pungetc when we know it's EOF.

Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>

 usr/dash/parser.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index f6c43be0..f0c919d5 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -208,8 +208,6 @@ list(int nlflag)
 		case TEOF:
 			if (heredoclist)
-			else
-				pungetc();		/* push back EOF on input */
 			return n1;

More information about the klibc mailing list