From: Tom Tromey <tromey@redhat.com>
To: Abhijit Halder <abhijit.k.halder@gmail.com>
Cc: "gdb-patches\@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: Re: [PATCH] PR-10034 Bad space handling in `set remote exec-file' command.
Date: Tue, 04 Oct 2011 15:51:00 -0000 [thread overview]
Message-ID: <m3ty7opxgp.fsf@fleche.redhat.com> (raw)
In-Reply-To: <CAOhZP9wi+uB80QyjN4Fv9W2ksX19ScBf1Z+Y15LQq0-oq8A0qA@mail.gmail.com> (Abhijit Halder's message of "Sun, 2 Oct 2011 12:51:45 +0530")
>>>>> "Abhijit" == Abhijit Halder <abhijit.k.halder@gmail.com> writes:
Abhijit> In the `set remote exec-file' command if we provide space at the end
Abhijit> of the file-name, the space is not being chopped off and being
Abhijit> considered as part of file-name. This behavior is inconsistent across
Abhijit> similar set commands like `set logging file' etc. My patch will fix
Abhijit> that problem. Please review this patch and put your comments.
I can't tell if you re-posted the same patch or if it has changes.
Please:
* If you are sending a ping, just send a ping, as a followup to the
patch being pinged, so that it threads properly in a threading mail
reader.
* If you are sending a new patch, again send it as a followup, and also
indicate what changed and why.
This patch doesn't have a test case, but should.
Abhijit> case var_string_noescape:
Abhijit> - if (arg == NULL)
Abhijit> - arg = "";
Abhijit> - if (*(char **) c->var != NULL)
Abhijit> - xfree (*(char **) c->var);
Abhijit> - *(char **) c->var = xstrdup (arg);
Abhijit> - break;
Why are you changing this case?
Abhijit> case var_optional_filename:
Abhijit> if (arg == NULL)
Abhijit> arg = "";
Abhijit> + else
Abhijit> + {
Abhijit> + /* Clear trailing whitespace. */
Abhijit> + char *ptr = arg + strlen (arg) - 1;
Abhijit> +
Abhijit> + while (ptr >= arg && (*ptr == ' ' || *ptr == '\t'))
Abhijit> + ptr--;
Abhijit> + *(ptr + 1) = '\0';
Why not use remove_trailing_whitespace? You mentioned it in an earlier
note, it seems best to just use it from the start.
What happens if the resulting string is empty?
At least for var_filename this should give an error.
Abhijit> @@ -419,7 +423,7 @@ cmd_show_list (struct cmd_list_element *
Abhijit> for (; list != NULL; list = list->next)
Abhijit> {
Abhijit> /* If we find a prefix, run its list, prefixing our output by its
Abhijit> - prefix (with "show " skipped). */
Abhijit> + prefix (with "show " skipped). */
Abhijit> if (list->prefixlist && !list->abbrev_flag)
Abhijit> {
Abhijit> struct cleanup *optionlist_chain
This hunk looks like a gratuitous change.
Tom
next prev parent reply other threads:[~2011-10-04 15:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-02 8:14 Abhijit Halder
2011-10-04 15:51 ` Tom Tromey [this message]
2011-10-05 4:19 ` Abhijit Halder
2011-10-05 14:01 ` Tom Tromey
2011-10-14 9:53 ` Abhijit Halder
2011-10-14 11:47 ` Abhijit Halder
-- strict thread matches above, loose matches on Subject: below --
2011-09-25 10:18 [PATCH] PR-10034 Bad space handling in set remote exec-file command Abhijit Halder
2011-09-26 5:41 ` Abhijit Halder
2011-09-26 16:01 ` Abhijit Halder
2011-09-29 8:27 ` Abhijit Halder
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=m3ty7opxgp.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=abhijit.k.halder@gmail.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