From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailgw1.comp.nus.edu.sg (84-20.comp.nus.edu.sg [137.132.84.20]) by sourceware.org (Postfix) with ESMTP id 169FF3858403 for ; Sat, 25 Sep 2021 12:59:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 169FF3858403 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=comp.nus.edu.sg Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=comp.nus.edu.sg Received: from localhost (avs3.comp.nus.edu.sg [192.168.49.7]) by mailgw1.comp.nus.edu.sg (Postfix) with ESMTP id D92A4F8087 for ; Sat, 25 Sep 2021 20:59:29 +0800 (+08) X-Virus-Scanned: amavisd-new at comp.nus.edu.sg Received: from mailgw1.comp.nus.edu.sg ([192.168.49.5]) by localhost (avs.comp.nus.edu.sg [192.168.49.7]) (amavisd-new, port 10024) with ESMTP id Ww9NNeIkZtL8 for ; Sat, 25 Sep 2021 20:59:23 +0800 (+08) Received: from mailauth1.comp.nus.edu.sg (mailauth1.comp.nus.edu.sg [192.168.49.3]) by mailgw1.comp.nus.edu.sg (Postfix) with ESMTP for ; Sat, 25 Sep 2021 20:59:17 +0800 (+08) Received: from localhost.localdomain (unknown [172.31.51.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: hujialun) by mailauth1.comp.nus.edu.sg (Postfix) with ESMTPSA id 8FDF06000F2B7 for ; Sat, 25 Sep 2021 20:59:17 +0800 (+08) From: Hu Jialun To: gcc-patches@gcc.gnu.org Subject: *PING* [PATCH] libiberty: allow comments in option file Date: Sat, 25 Sep 2021 20:58:23 +0800 Message-Id: <20210925125823.33378-1-hujialun@comp.nus.edu.sg> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210911064712.179872-1-hujialun@comp.nus.edu.sg> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2021 12:59:35 -0000 Hello, Sorry for bumping it again but I guess it was getting overlooked. I am very junior with mailing list open source contributions so please feel free to point out if I have inadvertantly done something in an incorrect way. The archive of the original email can be found at https://gcc.gnu.org/pipermail/gcc-patches/2021-September/579232.html and is also appended below. Best regards, Hu Jialun > Enables putting line comments into option files included using '@'. > > Comments begin with a ';' followed by whitespace, and terminates at the > end of the line. Backward compability should be satisfactory since ';' > is a character disallowed in DOS filenames and rarely used in filenames > or options anywhere else as well. > > Related discussion: https://gcc.gnu.org/legacy-ml/gcc/2011-02/msg00422.html > --- > libiberty/argv.c | 5 +++++ > libiberty/testsuite/test-expandargv.c | 12 ++++++++++++ > 2 files changed, 17 insertions(+) > > diff --git a/libiberty/argv.c b/libiberty/argv.c > index 48dcd102461..2bc7569b718 100644 > --- a/libiberty/argv.c > +++ b/libiberty/argv.c > @@ -194,6 +194,11 @@ char **buildargv (const char *input) > { > /* Pick off argv[argc] */ > consume_whitespace (&input); > + if (*input == ';') > + { > + for (; *input != '\n' && *input != EOS; ++input); > + continue; > + } > > if ((maxargc == 0) || (argc >= (maxargc - 1))) > { > diff --git a/libiberty/testsuite/test-expandargv.c b/libiberty/testsuite/test-expandargv.c > index 56c170f9ec6..5640b2b41cf 100644 > --- a/libiberty/testsuite/test-expandargv.c > +++ b/libiberty/testsuite/test-expandargv.c > @@ -142,6 +142,18 @@ const char *test_data[] = { > "b", > 0, > > + /* Test 7 - Check for comments in option file. */ > + "abc\n;def\nxy \\;z \\ ;gh", /* Test 7 data */ > + ARGV0, > + "@test-expandargv-7.lst", > + 0, > + ARGV0, > + "abc", > + "xy", > + ";z", > + " ;gh", > + 0, > + > 0 /* Test done marker, don't remove. */ > }; > > -- > 2.33.0