changeset 455:511f1b28c8d1

weather: Improve parsing of GPS coordinates.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 16 Oct 2017 11:14:07 +0300
parents 112f8afa2f04
children 102dc89488af
files weather.tcl
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/weather.tcl	Tue Oct 10 01:32:58 2017 +0300
+++ b/weather.tcl	Mon Oct 16 11:14:07 2017 +0300
@@ -315,7 +315,7 @@
   } elseif {$rcmd == "lahin" || $rcmd == "lähin" || $rcmd == "closest" || $rcmd == "nearest"} {
     # List stations nearest to given coordinates
     set qargs [join [lrange $rarglist 1 end] ""]
-    if {![regexp {^\s*@?(\d+|\d+\.\d+|\.\d+)\s*,\s*(\d+|\d+\.\d+|\.\d+)} $qargs -> d_lat d_lng]} {
+    if {![regexp {@?(\d+|\d+\.\d+|\.\d+)\s*,\s*(\d+|\d+\.\d+|\.\d+)} $qargs -> d_lat d_lng]} {
       weather_usage $upublic $unick $uchan $weather_msg_usage_nearest
       return 0
     }