public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Jeff Law <jlaw@ventanamicro.com>,
	Thomas Schwinge <tschwinge@baylibre.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCHv2 2/2] libiberty/buildargv: handle input consisting of only white space
Date: Mon, 05 Aug 2024 12:36:31 +0100	[thread overview]
Message-ID: <87v80fw69s.fsf@redhat.com> (raw)
In-Reply-To: <4a9c9ea7-56a4-45f5-bd75-903381a25e7f@ventanamicro.com>

Jeff Law <jlaw@ventanamicro.com> writes:

> On 7/29/24 6:51 AM, Andrew Burgess wrote:
>> Thomas Schwinge <tschwinge@baylibre.com> writes:
>> 
>>> Hi!
>>>
>>> On 2024-02-10T17:26:01+0000, Andrew Burgess <aburgess@redhat.com> wrote:
>>>> --- a/libiberty/argv.c
>>>> +++ b/libiberty/argv.c
>>>
>>>> @@ -439,17 +442,8 @@ expandargv (int *argcp, char ***argvp)
>>>>   	}
>>>>         /* Add a NUL terminator.  */
>>>>         buffer[len] = '\0';
>>>> -      /* If the file is empty or contains only whitespace, buildargv would
>>>> -	 return a single empty argument.  In this context we want no arguments,
>>>> -	 instead.  */
>>>> -      if (only_whitespace (buffer))
>>>> -	{
>>>> -	  file_argv = (char **) xmalloc (sizeof (char *));
>>>> -	  file_argv[0] = NULL;
>>>> -	}
>>>> -      else
>>>> -	/* Parse the string.  */
>>>> -	file_argv = buildargv (buffer);
>>>> +      /* Parse the string.  */
>>>> +      file_argv = buildargv (buffer);
>>>>         /* If *ARGVP is not already dynamically allocated, copy it.  */
>>>>         if (*argvp == original_argv)
>>>>   	*argvp = dupargv (*argvp);
>>>
>>> With that (single) use of 'only_whitespace' now gone:
>>>
>>>      [...]/source-gcc/libiberty/argv.c:128:1: warning: ‘only_whitespace’ defined but not used [-Wunused-function]
>>>        128 | only_whitespace (const char* input)
>>>            | ^~~~~~~~~~~~~~~
>>>
>> 
>> Sorry about that.
>> 
>> The patch below is the obvious fix.  OK to apply?
> Of course.
> jeff

Pushed.

Thanks,
Andrew


  reply	other threads:[~2024-08-05 11:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 16:50 [PATCH] libiberty/buildargv: POSIX behaviour for backslash handling Andrew Burgess
2024-01-02 11:22 ` Ping: " Andrew Burgess
2024-02-10 17:25 ` [PATCHv2 0/2] Changes to libiberty buildargv Andrew Burgess
2024-02-10 17:26   ` [PATCHv2 1/2] libiberty/buildargv: POSIX behaviour for backslash handling Andrew Burgess
2024-05-26 15:03     ` Jeff Law
2024-02-10 17:26   ` [PATCHv2 2/2] libiberty/buildargv: handle input consisting of only white space Andrew Burgess
2024-05-26 15:08     ` Jeff Law
2024-06-11 10:39       ` Andrew Burgess
2024-06-28 14:57         ` Andrew Burgess
2024-07-08 21:39         ` Jeff Law
2024-07-16 12:53           ` Andrew Burgess
2024-06-11 10:41       ` Andrew Burgess
2024-07-29 10:48     ` Thomas Schwinge
2024-07-29 12:51       ` Andrew Burgess
2024-07-30 20:23         ` Jeff Law
2024-08-05 11:36           ` Andrew Burgess [this message]
2024-04-27  9:48   ` [PATCHv2 0/2] Changes to libiberty buildargv Andrew Burgess

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=87v80fw69s.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jlaw@ventanamicro.com \
    --cc=tschwinge@baylibre.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).