From b313834338554afb9f365e62cf415b9cea25864e Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sun, 8 Feb 2015 22:44:02 +0000 Subject: [PATCH] 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 --- debian/dump1090-mutability.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/dump1090-mutability.config b/debian/dump1090-mutability.config index a55d2cc..871c483 100644 --- a/debian/dump1090-mutability.config +++ b/debian/dump1090-mutability.config @@ -133,7 +133,7 @@ is_ipaddrish_or_empty() { } 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() {