bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 0/4] New getprogname module


From: Jim Meyering
Subject: Re: [PATCH v2 0/4] New getprogname module
Date: Wed, 7 Sep 2016 11:05:52 -0700

On Wed, Sep 7, 2016 at 10:22 AM, Gisle Vanem <address@hidden> wrote:
> Jim Meyering wrote:
>
>> +# elif HAVE_DECL___ARGV
>> +  return last_component (__argv);
>
> This should be:
>   return last_component (*__argv);
>
> Or with a bit more care:
>   if (*__argv == NULL)
>      return ("?");
>   return last_component (__argv);

Thanks!
I fixed that and the copy/paste error mentioned below with a patch in
your name. Will push after you ACK.

> And in the test:
>
> +int
> +main (void)
> +{
> +  char const *p = getprogname ();
> +  assert (STREQ (p, "test-getprogname"));
> +  return 0;
> +}
>
>
> getprogname() would return "test-getprogname.exe" on
> Windows. Hence a fail.

I've fixed that with a separate patch to make it use EXEEXT.

> BTW, what is 'base' used for here:
>
> # elif HAVE_GETEXECNAME
>   const char *base = getexecname ();
>   if (!base)
>     base = "?";
>   return last_component (program_invocation_name);

Attachment: gnulib-getprogname-fix-errors.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]