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 (parent:
42d8bbb
)
charset: validate range parameters
author
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 8 Apr 2017 12:34:20 +0000
(14:34 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 24 Apr 2017 23:51:41 +0000
(
01:51
+0200)
charset.plp
patch
|
blob
|
history
diff --git
a/charset.plp
b/charset.plp
index c3477f124d9d9201d36e3593345602f292e9f590..2d4293d80adb98dd0c76198cf75d4f44f2576552 100644
(file)
--- a/
charset.plp
+++ b/
charset.plp
@@
-155,9
+155,17
@@
sub tabinput {
$visible->{$_} //= 0 for $row{parent};
}
$visible->{$_} //= 0 for $row{parent};
}
- if (defined $params and $params =~ m/^ (\d+) (-\d+)? /x) {
- $row{offset} = $1;
- $endpoint = -$2 if $2;
+ if (defined $params) {
+ $params =~ m{
+ \A (?<offset> \d+)
+ (?: [-] (?<endpoint> \d+) )? \z
+ }x or Alert([
+ "Unknown range parameters for $input",
+ "<q>$params</q> is not in format start(-end)",
+ ]);
+
+ $row{offset} = $+{offset};
+ $endpoint = $+{endpoint} if $+{endpoint};
}
if ($input =~ /^U([0-9a-f]+)(?:-([0-9a-f]+))?/) {
}
if ($input =~ /^U([0-9a-f]+)(?:-([0-9a-f]+))?/) {