Re: [PATCH 09/10] t: make sure that 'test_i18ngrep' got enough parameters

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

 



On Fri, Jan 26, 2018 at 01:37:07PM +0100, SZEDER Gábor wrote:

> Two of the previous patches in this series fixed two bogus
> 'test_i18ngrep' invocations that had neither a filename parameter not
> anything piped into their standard input, yet both managed to remain
> unnoticed for years.  A third similarly bogus invocation is currently
> lurking in 'pu' for a couple of weeks now.

Hrm. At first I thought this was redundant with the stdin thing in the
previous one. But that is only checking "did you _try_ to use stdin".
This is checking "did you accidentally use stdin, which was empty".

But I think maybe it's the opposite; the other one is redundant with
this one, since it would be hard to convince grep to read from stdin
anyway with this.

> Note that this is not quite perfect, as it doesn't account for any
> 'grep --options' given as parameters.  However, doing so would be far
> too complicated, considering that patters can start with dashes as
> well, and in the majority of the cases we don't use any such options
> anyway.

Yeah, I agree this would help most cases, but not hurt in others. I do
think Junio's "see if the final argument is a file" approach seems like
it would cover us pretty accurately, though, without having to get too
intimate with grep options.

-Peff



[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