From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 736 invoked by alias); 4 Nov 2009 16:17:43 -0000 Received: (qmail 724 invoked by uid 22791); 4 Nov 2009 16:17:42 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Nov 2009 16:17:38 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 84B1E2BD30F; Wed, 4 Nov 2009 11:17:36 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BVrzB14VX8kH; Wed, 4 Nov 2009 11:17:36 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id B88662BD300; Wed, 4 Nov 2009 11:17:35 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id A1C33F5905; Wed, 4 Nov 2009 08:17:27 -0800 (PST) Date: Wed, 04 Nov 2009 16:17:00 -0000 From: Joel Brobecker To: Jon Beniston Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Don't split executable paths with spaces in into multiple arguments Message-ID: <20091104161727.GH4557@adacore.com> References: <003c01ca5d52$1715da50$45418ef0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003c01ca5d52$1715da50$45418ef0$@com> User-Agent: Mutt/1.5.18 (2008-05-17) 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 X-SW-Source: 2009-11/txt/msg00080.txt.bz2 > gdb/ > 2009-11-04 Jon Beniston > > * remote-sim.c(gdbsim_create_inferior) Quote executable path in case > it > contains spaces. OK. This is not handling the case where the filename contains a double quote, but it is not making things worse, and double-quotes in filenames are probably extremely rare. Just a tiny formatting request: Please add a space before "(gdbsim_create_inferior)" and make sure that each line does not exceed 80 character. > - len = strlen (exec_file) + 1 + strlen (args) + 1 + /*slop */ 10; > + len = 2 + strlen (exec_file) + 1 + strlen (args) + 1 + /*slop */ 10; This is not your doing, but the remote-sim code is full of "slop" and "slack", etc, and I wonder how hard it would be to make it crash due to not enough "slack" :-(. -- Joel