On Wed, 15 May 2013 16:16:53 +0300, Arto Jonsson wrote:

> I asked stsp@ about the multibyte support yesterday and it was his
> opinion that it's not currently needed.

Seemed like it might be useful for the future but I suppose we can
add things like this when we have better multibyte support.

>     if (donumber) {
>         (void)printf(format, width, line);
>         line += incr;
>     } else
>         (void)printf("%*s", width, "");
> 
> > +           (void)printf("%s%s", sep, buffer);
> 
> This is incorrect. It's a bug in Free/NetBSD implementation. The
> standard says that:
> 
>      When line numbers are suppressed for a portion of the page; the
>      <separator> is also suppressed.
> 
> I've been thinking how this should be correctly implemented but I
> haven't figured it out yet.

If that's the case, can't we just do:

    if (donumber) {
        (void)printf(format, width, line);
        line += incr;
        (void)fputs(sep, stdout);
    } else {
        (void)printf("%*s", width, "");
    }
    (void)fwrite(buffer, linelen, 1, stdout);

That assumes using getline().

 - todd

Reply via email to