Fix weather alerts with empty phenomena
[khatus.git] / bin / khatus_parse_metar_d_output
index 49f1067..b228390 100755 (executable)
@@ -4,7 +4,7 @@
 # metar format.
 
 function strip(s) {
-       sub("^ *", "", s)
+    sub("^ *", "", s)
     sub(" *$", "", s)
     return s
 }
@@ -38,7 +38,10 @@ END {
         temp_fahrenheit = (temp_celsius * (9 / 5)) + 32
         print "temperature " temp_fahrenheit "°F"
         for (i=first["Phenomena"]; i<=last["Phenomena"]; i++) {
-            print "phenomena " values[i]
+            phenomenon = values[i]
+            if (phenomenon) {
+                print "phenomenon " phenomenon
+            }
         }
     }
 }
This page took 0.026331 seconds and 4 git commands to generate.