Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Maciej W. Rozycki" <macro@mips.com>
Cc: gdb-patches@sourceware.org, chris@mips.com, macro@linux-mips.org
Subject: Re: Remove a trailing space resulting from file name completion
Date: Fri, 11 May 2007 08:12:00 -0000	[thread overview]
Message-ID: <uveezg4ps.fsf@gnu.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0705101326150.29962@perivale.mips.com> 	(macro@mips.com)

> Date: Thu, 10 May 2007 14:06:32 +0100 (BST)
> From: "Maciej W. Rozycki" <macro@mips.com>
> cc: Chris Dearman <chris@mips.com>, "Maciej W. Rozycki" <macro@linux-mips.org>
> 
>  As a file with a trailing space is indeed not desired in about any case, 
> I propose the following change to be included.
> 
> 2007-05-10  Chris Dearman  <chris@mips.com>
>             Maciej W. Rozycki  <macro@mips.com>
> 
> 	* cli/cli-setshow.c (do_setshow_command): Remove trailing
> 	whitespace when setting a var_filename.

This is okay, but suppose I _did_ want a file name with trailing
space: how would I go about that in this situation?  Is there a way?
If there isn't, either we should introduce one, or else we should tell
in the command's doc string and in the manual that this is a
restriction.

> +++ gdb/src/gdb/cli/cli-setshow.c	2007-02-13 13:51:29.000000000 +0000
> @@ -192,6 +192,13 @@
>  	    error_no_arg (_("filename to set it to."));
>  	  if (*(char **) c->var != NULL)
>  	    xfree (*(char **) c->var);
> +	  {
> +	    /* Clear trailing whitespace of filename.  */
> +	    char *ptr = arg + strlen (arg) - 1;
> +	    while (ptr >= arg && (*ptr == ' ' || *ptr == '\t'))
> +	      ptr--;
> +	    *(ptr + 1) = '\0';
> +	  }

Shouldn't you again check whether anything was left after stripping
whitespace, and if not, output the same ``no filename to set it to"
error message?


  parent reply	other threads:[~2007-05-11  8:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10 13:07 Maciej W. Rozycki
2007-05-10 13:17 ` Daniel Jacobowitz
2007-05-11  8:12 ` Eli Zaretskii [this message]
2007-05-14 12:40   ` Maciej W. Rozycki

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=uveezg4ps.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=chris@mips.com \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@linux-mips.org \
    --cc=macro@mips.com \
    /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