git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
6b769e0
)
keyboard: avoid warning for empty mode parameter
author
Mischa POSLAWSKY
<perl@shiar.org>
Tue, 23 Jun 2015 14:08:18 +0000
(16:08 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 21 Sep 2015 22:20:08 +0000
(
00:20
+0200)
Empty string splits to an empty list, resulting in a benign warning:
> Odd number of elements in hash assignment
Shiar_Sheet/Keyboard.pm
patch
|
blob
|
history
diff --git
a/Shiar_Sheet/Keyboard.pm
b/Shiar_Sheet/Keyboard.pm
index 90ec4e827daee68cc9279315a470de17719b0d73..2b3cc8629e8033d0d818dfd008b6e7efafb16418 100644
(file)
--- a/
Shiar_Sheet/Keyboard.pm
+++ b/
Shiar_Sheet/Keyboard.pm
@@
-126,7
+126,7
@@
sub print_key {
sub print_rows {
my $self = shift;
my %moderows = (
- -DEFAULT => !
@_ ? '' :
split(/(?:\s*([^=\s]*)=\s*)/, shift),
+ -DEFAULT => !
!@_ && $_[0] ne '' &&
split(/(?:\s*([^=\s]*)=\s*)/, shift),
# plus specific mode overrides prefixed by '='
);
my $defrows = shift || [2, 1, 0];