[hamradio-commits] [dump1090-mutability] 86/172: Make the is_number regex accept numbers beginning with -0

Matteo F. Vescovi mfv at moszumanska.debian.org
Sun Jan 28 13:45:48 UTC 2018


This is an automated email from the git hooks/post-receive script.

mfv pushed a commit to branch master
in repository dump1090-mutability.

commit 0ae76010a3e98dd633ba0c4cc583afc8d0b79615
Author: Oliver Jowett <oliver at mutability.co.uk>
Date:   Sun Feb 8 22:44:02 2015 +0000

    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() {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090-mutability.git



More information about the pkg-hamradio-commits mailing list