[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] ptx: avoid --format long option falling through into --help
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] ptx: avoid --format long option falling through into --help |
Date: |
Wed, 26 Mar 2014 10:11:19 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
>>From dfa2279a955b9cdd6f941ae2eb05bd527081941f Mon Sep 17 00:00:00 2001
> From: Bernhard Voelker <address@hidden>
> Date: Wed, 26 Mar 2014 09:01:36 +0100
> Subject: [PATCH] ptx: avoid --format long option falling through into --help
>
> * src/ptx.c (main): Add a 'break' after the --format handling case.
> Otherwise it would fall through into the usage case.
> * tests/misc/ptx.pl: Add test cases for --format=tex and --format=roff.
> * NEWS (Bug fixes): Mention the fix.
> Bug introduced in 1999-04-04 commit, SH-UTILS-1_16f-269-gd815c15.
> Spotted by coverity (MISSING_BREAK).
> diff --git a/tests/misc/ptx.pl b/tests/misc/ptx.pl
> index 2db953a..8a91d61 100755
> --- a/tests/misc/ptx.pl
> +++ b/tests/misc/ptx.pl
> @@ -33,6 +33,13 @@ my @Tests =
>
> # with coreutils-6.12 and earlier, this would act like "ptx F1 F1"
> ["2files", '-g1 -w1', {IN=>{F1=>"a"}}, {IN=>{F2=>"b"}}, {OUT=>" a\n b\n"}],
> +
> +# with coreutils-8.22 and earlier, the --format long option would
> +# fall through into the --help case.
> +["format-r", '--format=roff', {IN=>"foo\n"},
> + {OUT=>".xx \"\" \"\" \"foo\" \"\"\n"}],
> +["format-t", '--format=tex', {IN=>"foo\n"},
> + {OUT=>"\\xx {}{}{foo}{}{}\n"}],
> );
>
> @Tests = triple_test \@Tests;
>
Thanks for the test.
+1
Pádraig.