File: fix-uninitialized-value-warning.patch

package info (click to toggle)
libdata-sorting-perl 0.9-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 196 kB
  • sloc: perl: 863; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 881 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Subject: Fix uninitialized value $flagname warning
Date: Wed, 22 Jul 2009 13:29:28 +0200
From: Ansgar Burchardt <ansgar@43-1.org>
X-Forwarded: https://rt.cpan.org/Ticket/Display.html?id=48088

This fixes the warning

   Use of uninitialized value $flagname in string eq at
   [...]/lib/Data/Sorting.pm line 420.

that showed up in the test suite.
--- libdata-sorting-perl.orig/Sorting.pm
+++ libdata-sorting-perl/Sorting.pm
@@ -419,7 +419,7 @@
     my ( $flagname ) = ( $token =~ /^\-(\w+)$/ );
     if ( $flagname and $SupportedOptions{$flagname} ) {
       $state{ $flagname } = shift @arguments;
-    } elsif ( $flagname eq 'sortkey' ) {
+    } elsif ( defined($flagname) and $flagname eq 'sortkey' ) {
       push @rules, { @DefaultState, %state, 'sortkey' => shift @arguments };
     } elsif ( ref($token) eq 'HASH' ) {
       push @rules, { @DefaultState, %state, %$token };