From 6d50543182b45a6caa5c04b7dd8d6ce808db435d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20A=2E=20Holm?= Date: Thu, 4 Nov 2010 05:40:11 +0100 Subject: [PATCH] Let trackpoint() check lat, lon and ele and print the erroneous value. 2/244 tests still fail. 6900fc44-e7cd-11df-8bbc-fefdb24f8e10 --- GPST.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GPST.pm b/GPST.pm index a424d03..aed1919 100644 --- a/GPST.pm +++ b/GPST.pm @@ -56,7 +56,12 @@ sub trackpoint { ) { ($Dat{'print_time'} = 0); } - "$Dat{'lat'}$Dat{'lon'}" =~ /[^\d\.\-\+]/ && return(undef); + $Dat{'lat'} =~ /[^\d\.\-\+]/ && + (warn("$main::progname: Invalid value in latitude value: '$Dat{'lat'}'\n"), return(undef)); + $Dat{'lon'} =~ /[^\d\.\-\+]/ && + (warn("$main::progname: Invalid value in longitude value: '$Dat{'lon'}'\n"), return(undef)); + length($Dat{'ele'}) && $Dat{'ele'} =~ /[^\d\.\-\+]/ && + (warn("$main::progname: Invalid value in elevation value: '$Dat{'ele'}'\n"), return(undef)); defined($Dat{'lat'}) || ($Dat{'lat'} = ""); defined($Dat{'lon'}) || ($Dat{'lon'} = ""); -- 2.11.4.GIT