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 7:37 AM, SZEDER Gábor <szeder.dev@xxxxxxxxx> wrote:
> Two of the previous patches in this series fixed two bogus
> 'test_i18ngrep' invocations that had neither a filename parameter not

s/not/nor/

> 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.
>
> Try to catch similar mistakes in the future by ensuring that
> 'test_i18ngrep' has at least two parameters, not including an optional
> '!' to negate the pattern.  Perform these checks after we made sure
> that there is no data on the 'test_i18ngrep's standard input, so if
> the filename parameter is missing because someone is piping a git
> command's output into this function, then they would get the more
> relevant error message.
>
> 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.
>
> Signed-off-by: SZEDER Gábor <szeder.dev@xxxxxxxxx>




[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