From: "Jon Beniston" <jon@beniston.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH] Don't split executable paths with spaces in into multiple arguments
Date: Wed, 04 Nov 2009 13:26:00 -0000 [thread overview]
Message-ID: <003c01ca5d52$1715da50$45418ef0$@com> (raw)
Hi,
The following patch prevents executable paths with spaces in them from being
passed to the simulator as multiple arguments.
OK to apply?
Cheers,
Jon
gdb/
2009-11-04 Jon Beniston <jon@beniston.com>
* remote-sim.c(gdbsim_create_inferior) Quote executable path in case
it
contains spaces.
===================================================================
--- remote-sim.c (revision 41)
+++ remote-sim.c (working copy)
@@ -458,10 +458,13 @@
if (exec_file != NULL)
{
- len = strlen (exec_file) + 1 + strlen (args) + 1 + /*slop */ 10;
+ len = 2 + strlen (exec_file) + 1 + strlen (args) + 1 + /*slop */ 10;
arg_buf = (char *) alloca (len);
arg_buf[0] = '\0';
+ /* Add quotes around exec_file in case there are spaces in the path.
*/
+ strcat (arg_buf, "\"");
strcat (arg_buf, exec_file);
+ strcat (arg_buf, "\"");
strcat (arg_buf, " ");
strcat (arg_buf, args);
argv = buildargv (arg_buf);
next reply other threads:[~2009-11-04 13:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-04 13:26 Jon Beniston [this message]
2009-11-04 16:17 ` Joel Brobecker
2009-11-09 17:42 ` Tom Tromey
2009-11-09 17:46 ` Joel Brobecker
2009-11-09 18:04 ` Tom Tromey
2009-11-09 21:11 ` Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='003c01ca5d52$1715da50$45418ef0$@com' \
--to=jon@beniston.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox