fixed parser if the line type is not recognised
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Sun, 22 Jan 2012 22:53:56 +0100
changeset 13 c5ee81217f70
parent 12 84b0f3ca474a
child 14 3d8176df0461
fixed parser if the line type is not recognised
igc.cc
--- a/igc.cc	Sun Jan 22 20:46:02 2012 +0100
+++ b/igc.cc	Sun Jan 22 22:53:56 2012 +0100
@@ -7,7 +7,7 @@
 	in >> c;
 	switch (c) {
 	    case 'A': 
-		if (device_.isEmpty()) device_ = in.readLine(); 
+		device_ = in.readLine(); 
 		break;
 	    case 'H': {
 		QString line  = in.readLine();
@@ -21,10 +21,14 @@
 		    if (s.length() == 6) 
 			s.insert(4, "20"); // FIXME: current year?
 		    date_ = QDate::fromString(s, "ddMMyyyy");
+		    }
 		}
-	    }
-	    break;
-	    case 'B': fixes_ << in.readLine(); break;
+		break;
+	    case 'B': 
+		fixes_ << in.readLine(); 
+		break;
+	    default:
+		(void) in.readLine();
 	}
     }
 }