diff mbox

[1/3,PARSER] Removed unnecessary pungetc on EOF from parser

Message ID E1XlwGN-0005XK-TN@gondolin.me.apana.org.au (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Herbert Xu Nov. 5, 2014, 8:48 a.m. UTC
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@gondor.apana.org.au>
---

 ChangeLog    |    4 ++++
 src/parser.c |    2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/ChangeLog b/ChangeLog
index 5212a9a..70ccfed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@ 
+2014-10-28  Herbert Xu <herbert@gondor.apana.org.au>
+
+	* Removed unnecessary pungetc on EOF from parser.
+
 2014-10-27  Herbert Xu <herbert@gondor.apana.org.au>
 
 	* Add printf support for format string a, A, and F.
diff --git a/src/parser.c b/src/parser.c
index f6c43be..f0c919d 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -208,8 +208,6 @@  list(int nlflag)
 		case TEOF:
 			if (heredoclist)
 				parseheredoc();
-			else
-				pungetc();		/* push back EOF on input */
 			tokpushback++;
 			return n1;
 		default: