On 7/29/24 6:51 AM, Andrew Burgess wrote:
Thomas Schwinge <tschwi...@baylibre.com> writes:
Hi!
On 2024-02-10T17:26:01+0000, Andrew Burgess <aburg...@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