summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2013-05-05 08:43:10 +0200
committerGuillem Jover <guillem@debian.org>2013-05-08 04:58:08 +0200
commite1fba416fa57c7cb18e52cc994f6d3608fbfe7e7 (patch)
treee53a1d1c7402ca249fcd950172976b1f4379f4e1
parent57edbd58ba0a53154aced9822c304ac33a543090 (diff)
downloaddpkg-e1fba416fa57c7cb18e52cc994f6d3608fbfe7e7.tar.gz
dselect: Change mkcurkeys p() to take explicit key and value arguments
-rwxr-xr-xdselect/mkcurkeys.pl15
1 files changed, 7 insertions, 8 deletions
diff --git a/dselect/mkcurkeys.pl b/dselect/mkcurkeys.pl
index 1cc0052d7..2a70099ea 100755
--- a/dselect/mkcurkeys.pl
+++ b/dselect/mkcurkeys.pl
@@ -45,7 +45,7 @@ for my $i (1 .. 26) {
$let++;
}
-our ($k, $v);
+my ($k, $v);
open(my $header_fh, '<', $ARGV[1]) || die $!;
while (<$header_fh>) {
@@ -84,7 +84,7 @@ for my $i (33 .. 126) {
$k= $i;
$v = pack('C', $i);
if ($v eq ',') { $comma=$k; next; }
- p();
+ p($k, $v);
}
## no critic (BuiltinFunctions::ProhibitReverseSortBlock)
@@ -99,17 +99,14 @@ for $k (sort {
$v= $name{$k} if defined($name{$k});
$v= $over{$k} if defined($over{$k});
next if $v eq '[elide]';
- p();
+ p($k, $v);
}
for my $i (1 .. 63) {
- $k= "KEY_F($i)"; $v= "F$i";
- p();
+ p("KEY_F($i)", "F$i");
}
-$k = $comma;
-$v = ',';
-p();
+p($comma, ',');
print(<<'END') || die $!;
{ -1, 0 }
@@ -133,6 +130,8 @@ sub capit {
}
sub p {
+ my ($k, $v) = @_;
+
$v =~ s/["\\]/\\$&/g;
printf(" { %-15s \"%-20s },\n",
$k.',',