Make the is_number regex accept numbers beginning with -0
Also ends up simpler, too - originally I was trying to avoid accepting e.g. "+0" or "-0" but that's not really a big deal. Fixes #14
This commit is contained in:
parent
a49b5b8830
commit
b313834338
2
debian/dump1090-mutability.config
vendored
2
debian/dump1090-mutability.config
vendored
|
@ -133,7 +133,7 @@ is_ipaddrish_or_empty() {
|
||||||
}
|
}
|
||||||
|
|
||||||
is_number() {
|
is_number() {
|
||||||
if echo "$1" | grep -Eq '^(0|[+-]?[1-9][0-9]*)(\.[0-9]+)?$'; then return 0; else return 1; fi
|
if echo "$1" | grep -Eq '^([+-]?[0-9][0-9]*)(\.[0-9]+)?$'; then return 0; else return 1; fi
|
||||||
}
|
}
|
||||||
|
|
||||||
is_number_or_empty() {
|
is_number_or_empty() {
|
||||||
|
|
Loading…
Reference in a new issue