From patchwork Wed Nov 5 08:48:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 5232821 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-dash@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B2FA79F295 for ; Wed, 5 Nov 2014 08:48:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F38FA20179 for ; Wed, 5 Nov 2014 08:48:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B43D20173 for ; Wed, 5 Nov 2014 08:48:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751176AbaKEIs0 (ORCPT ); Wed, 5 Nov 2014 03:48:26 -0500 Received: from helcar.apana.org.au ([209.40.204.226]:37020 "EHLO helcar.apana.org.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750860AbaKEIs0 (ORCPT ); Wed, 5 Nov 2014 03:48:26 -0500 Received: from gondolin.me.apana.org.au ([192.168.0.6]) by fornost.hengli.com.au with esmtp (Exim 4.80 #3 (Debian)) id 1XlwGO-0005Rp-Ap for ; Wed, 05 Nov 2014 19:48:24 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 4.80) (envelope-from ) id 1XlwGN-0005XK-TN; Wed, 05 Nov 2014 16:48:23 +0800 Subject: [PATCH 1/3] [PARSER] Removed unnecessary pungetc on EOF from parser References: <20141105084749.GA21242@gondor.apana.org.au> To: dash@vger.kernel.org Message-Id: From: Herbert Xu Date: Wed, 05 Nov 2014 16:48:23 +0800 Sender: dash-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dash@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 --git a/ChangeLog b/ChangeLog index 5212a9a..70ccfed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-10-28 Herbert Xu + + * Removed unnecessary pungetc on EOF from parser. + 2014-10-27 Herbert Xu * 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: