Re: [PATCH 2/5] t4211: demonstrate empty -L range crash

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

 



On Tue, Jul 23, 2013 at 10:28:05AM -0400, Eric Sunshine wrote:
> Signed-off-by: Eric Sunshine <sunshine@xxxxxxxxxxxxxx>
> ---
>  t/t4211-line-log.sh | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
> index 7776f93..1db1edd 100755
> --- a/t/t4211-line-log.sh
> +++ b/t/t4211-line-log.sh
> @@ -64,4 +64,12 @@ test_bad_opts "-L 1,1000:b.c" "has only.*lines"
>  test_bad_opts "-L :b.c" "argument.*not of the form"
>  test_bad_opts "-L :foo:b.c" "no match"
>  
> +# There is a separate bug when an empty -L range is the first -L encountered,
> +# thus to demonstrate this particular bug, the empty -L range must follow a
> +# non-empty -L range.
> +test_expect_failure '-L {empty-range} (any -L)' '
> +	n=$(expr $(cat b.c | wc -l) + 1) &&

You could avoid the 'cat' here and patch in 4/5 by doing $(wc -l <b.c).

(Side question: the test suite is full with similar constructs, i.e.
redirecting file contents to stdin, but why not just use wc -l b.c,
i.e. let wc open the file?)

--
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]