From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26982 invoked by alias); 20 Apr 2014 06:07:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26951 invoked by uid 89); 20 Apr 2014 06:07:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_40,SPF_SOFTFAIL autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mtaout24.012.net.il Received: from mtaout24.012.net.il (HELO mtaout24.012.net.il) (80.179.55.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 20 Apr 2014 06:07:38 +0000 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N4B00800F705X00@mtaout24.012.net.il>; Sun, 20 Apr 2014 09:05:48 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N4B00OQWFLOJO90@mtaout24.012.net.il>; Sun, 20 Apr 2014 09:05:48 +0300 (IDT) Date: Sun, 20 Apr 2014 06:07:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH 1/2] Windows libibery: Don't quote args unnecessarily In-reply-to: <1826621422.9537772.1397939013891.JavaMail.zimbra@redhat.com> To: Kai Tietz Cc: mingw.android@gmail.com, gcc-patches@gcc.gnu.org, ktietz70@gmail.com, binutils@sourceware.org, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83vbu4fs9w.fsf@gnu.org> References: <1397936424-2290-1-git-send-email-mingw.android@gmail.com> <1397936424-2290-2-git-send-email-mingw.android@gmail.com> <1826621422.9537772.1397939013891.JavaMail.zimbra@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-04/txt/msg00392.txt.bz2 > Date: Sat, 19 Apr 2014 16:23:33 -0400 (EDT) > From: Kai Tietz > Cc: gcc-patches@gcc.gnu.org, ktietz70@gmail.com, "binutils@sourceware.org Development" , gdb-patches@sourceware.org > > > + /* We only quote arguments that contain spaces, \n \t \v or " characters > > + to prevent wasting 2 chars per argument of the CreateProcess 32k char > > + limit We need only escape embedded double-quotes and immediately > > preceeding backslash characters. A sequence of backslach characters > > that is not follwed by a double quote character will not be > > escaped. */ > > + needs_quotes = 0; > > for (j = 0; argv[i][j]; j++) > > { > > + if (argv[i][j] == ' ' || argv[i][j] == '\n' || > > + argv[i][j] == '\t' || argv[i][j] == '"' ) > > + { > Here seems to be an intend issue. > > + needs_quotes = 1; > > + } I think you can omit the \n case, since command arguments on Windows cannot possibly include newlines. Also, the comment speaks about \v, but I see no code to handle that (and am not sure you should bother in that case as well). > Patch itself makes sense. Yes, I agree.