Re: [PATCH] grep: make show_line more portable

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

 



Brian Gernhardt <benji@xxxxxxxxxxxxxxxxxx> writes:

> On OS X the printf specifier "%.0s" outputs the entire string instead
> of 0 characters as POSIX states.
>
> In addition, for * width or precision printf expects an integer
> argument.  On systems were regoff_t is 64-bit, unexpected results can
> occur.

I would prefer to see these two issues solved as separate issues.

Specifically, I'd like to know if the patch from me to you a few message
ago solves the issue.

If you still need a "some implementations of printf is broken with respect
to 0 precision" workaround on top of that patch, we would want to add it
separately, but it may have to cover not just this printf(), as I am not
convinced this is the only place that lets (integer) 0 passed to the
"%.*s" format.  That patch needs to be written after a separate auditing
of output from "git grep -n -e 'printf.*%\.\*s'", which I do not think
happened yet (at least I haven't done that, and I somehow do not think you
have yet either).


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux