aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl/fixes/getopt-long-4.diff
blob: a09507c4c631f26a7c49d98dd0ccfb8ee6c6d74e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From d315170f16aaace8bebf44e652d83c594621519e Mon Sep 17 00:00:00 2001
From: Johan Vromans <jvromans@squirrel.nl>
Date: Tue, 13 Jun 2017 13:26:00 +0200
Subject: [PATCH] Fix issue #122068.

Origin: backport, https://github.com/sciurius/perl-Getopt-Long/commit/2d16f355e25537aa742eb2833a7d52a63051429b
Bug: https://rt.cpan.org/Ticket/Display.html?id=122068
Bug-Debian: https://bugs.debian.org/864544
Patch-Name: fixes/getopt-long-4.diff

---
 cpan/Getopt-Long/lib/Getopt/Long.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cpan/Getopt-Long/lib/Getopt/Long.pm b/cpan/Getopt-Long/lib/Getopt/Long.pm
index e7e033b..4cdfe92 100644
--- a/cpan/Getopt-Long/lib/Getopt/Long.pm
+++ b/cpan/Getopt-Long/lib/Getopt/Long.pm
@@ -1121,6 +1121,12 @@ sub FindOption ($$$$$) {
 	    $optargtype = 3;
 	}
 	if(($optargtype == 0) && !$mand) {
+	    if ( $type eq 'I' ) {
+		# Fake incremental type.
+		my @c = @$ctl;
+		$c[CTL_TYPE] = '+';
+		return (1, $opt, \@c, 1);
+	    }
 	    my $val
 	      = defined($ctl->[CTL_DEFAULT]) ? $ctl->[CTL_DEFAULT]
 	      : $type eq 's'                 ? ''