Re: [hackers] [PATCH v3][sbase] cmp: Make output of error message POSIX compliant

From: Richard Ipsum <richardipsum_AT_fastmail.co.uk>
Date: Tue, 21 May 2019 05:37:27 +0100

On Mon, May 20, 2019 at 07:06:04PM -0700, Michael Forney wrote:
> On 2019-05-20, Laslo Hunhold <dev_AT_frign.de> wrote:
> > On Mon, 20 May 2019 09:36:32 +0100
> > Richard Ipsum <richardipsum_AT_fastmail.co.uk> wrote:
> >
> > Dear Richard,
> >
> >> - weprintf("cmp: EOF on %s\n",
> >> argv[(b[0] != EOF)]);
> >> + fprintf(stderr, "cmp: EOF on %s\n",
> >
> > maybe I am missing something, but weprintf() already does print to
> > stderr. What does this patch change?
>
> weprintf also adds a prefix "%s: ", argv0, so we end up with a double prefix
>
> cmp: cmp: EOF on ...
>
> I think Richard is using fprintf directly since POSIX specifies that
> the message should be exactly
>
> "cmp: EOF on %s%s\n", <name of shorter file>, <additional info>
>
> which might not be the case if cmp is called by its absolute path.
>

Exactly

Thanks,
Richard
Received on Tue May 21 2019 - 06:37:27 CEST

This archive was generated by hypermail 2.3.0 : Tue May 21 2019 - 07:12:24 CEST