From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9725 invoked by alias); 6 Dec 2005 10:53:04 -0000 Received: (qmail 9708 invoked by uid 22791); 6 Dec 2005 10:53:01 -0000 X-Spam-Check-By: sourceware.org Received: from lon-del-04.spheriq.net (HELO lon-del-04.spheriq.net) (195.46.50.101) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 06 Dec 2005 10:52:58 +0000 Received: from lon-out-01.spheriq.net ([195.46.50.129]) by lon-del-04.spheriq.net with ESMTP id jB6AqtKi003574 for ; Tue, 6 Dec 2005 10:52:55 GMT Received: from lon-cus-01.spheriq.net (lon-cus-01.spheriq.net [195.46.50.37]) by lon-out-01.spheriq.net with ESMTP id jB6Aqs60018796 for ; Tue, 6 Dec 2005 10:52:54 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by lon-cus-01.spheriq.net with ESMTP id jB6AqlnT004480 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 6 Dec 2005 10:52:51 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4E80DDA90; Tue, 6 Dec 2005 10:51:23 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 60012) id 3AE7C472FC; Tue, 6 Dec 2005 10:54:28 +0000 (GMT) Received: from zeta.dmz-eu.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DADE1759AE; Tue, 6 Dec 2005 10:54:27 +0000 (UTC) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 164F8472DD; Tue, 6 Dec 2005 10:54:27 +0000 (GMT) Received: from [164.129.15.13] (terrorhawk.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CHA78133 (AUTH "andrew stubbs"); Tue, 6 Dec 2005 10:51:18 GMT Message-ID: <43956C93.5070709@st.com> Date: Tue, 06 Dec 2005 20:28:00 -0000 From: Andrew STUBBS User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) MIME-Version: 1.0 To: Jim Blandy Cc: GDB Patches Subject: Re: [PATCH] Allow spaces in filenames to load command References: <43949300.1040203@st.com> <8f2776cb0512051250u2a6083dbma95e6b352410dea8@mail.gmail.com> In-Reply-To: <8f2776cb0512051250u2a6083dbma95e6b352410dea8@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-O-Spoofed: Not Scanned X-O-General-Status: No X-O-Spam1-Status: Not Scanned X-O-Spam2-Status: Not Scanned X-O-URL-Status: Not Scanned X-O-Virus1-Status: No X-O-Virus2-Status: Not Scanned X-O-Virus3-Status: No X-O-Virus4-Status: No X-O-Virus5-Status: Not Scanned X-O-Image-Status: Not Scanned X-O-Attach-Status: Not Scanned X-SpheriQ-Ver: 4.2.0 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00111.txt.bz2 Jim Blandy wrote: > On 12/5/05, Andrew STUBBS wrote: > >>2005-12-05 Andrew Stubbs >> >> * symfile.c (generic_load): Use buildargv and tilde_expand >> to parse file names with quoting, spaces and tildes properly. > > > Hi, Andrew. I like the idea of using buildargv and tilde_expand. > > >>+ /* Do we have args from the user or from the default? */ >>+ if (exec_bfd && args == get_exec_file (1)) >>+ /* The string is ONLY the file name. */ >>+ filename = args; > > > What is this about? This seems very fragile. > load_command passes either the string from the command line or else the result of get_exec_file(). If it does the latter then we must not attempt to use build_argv because it would not be properly quoted and would break if there were spaces. How about a new comment? /* load_command() may have passed a string from the user or from get_exec_file(). In the latter case do not do build_argv. */ Andrew