# HG changeset patch # User Matti Hamalainen # Date 1508141647 -10800 # Node ID 511f1b28c8d1ec450d74232795b730f238cf6ccd # Parent 112f8afa2f04aaaf08b10054294c0254cc521091 weather: Improve parsing of GPS coordinates. diff -r 112f8afa2f04 -r 511f1b28c8d1 weather.tcl --- 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 }