tests: Increase root partitions size to 1.2G.
[jackhill/guix/guix.git] / gnu / packages / patches / quilt-compat-getopt-fix-option-with-nondigit-param.patch
1 From: Jean Delvare <jdelvare@suse.de>
2 Subject: compat/getopt: Allow non-digit parameter embedded in short option
3
4 The compatibility getopt script allows only digit parameters to be
5 embedded in short options. Util-linux's getopt implementation does
6 not have such a restriction and allows any parameter to be embedded
7 in short options. As a consequence, using the compatibility getopt
8 script would choke for example on "-pab", which is a legal option
9 of the "quilt refresh" command.
10
11 Remove the limitation on digits so that the compatibility getopt
12 script allows what util-linux allows. This fixes the second half
13 of bug #54772:
14 https://savannah.nongnu.org/bugs/index.php?54772
15
16 As a side note, this feature of the compatibility script was broken
17 anyway, as it would output the digits in reverse order.
18
19 Signed-off-by: Jean Delvare <jdelvare@suse.de>
20 ---
21 compat/getopt.in | 13 ++++---------
22 1 file changed, 4 insertions(+), 9 deletions(-)
23
24 --- quilt.orig/compat/getopt.in 2018-10-03 16:05:56.818667040 +0200
25 +++ quilt/compat/getopt.in 2018-10-03 16:12:17.624841732 +0200
26 @@ -108,15 +108,10 @@ foreach my $word (@words) {
27 if (scalar(@letters) == 0) {
28 $need_param = $letter;
29 } else {
30 - # short options can have numerical args
31 - # embedded in the short option list: -UO
32 - die "unexpected character after option $letter"
33 - if ($letters[$#letters] !~ /[0-9]/);
34 - my @digits;
35 - while (scalar(@letters) && ($letters[$#letters] =~ /[0-9]/)) {
36 - push @digits, pop @letters;
37 - }
38 - push @options, quote_word(join('', reverse @digits));
39 + # short options can have args
40 + # embedded in the short option list
41 + push @options, quote_word(join('', reverse @letters));
42 + @letters = ();
43 }
44 }
45 }