From ebe2da9d6f7ed77977ff533b46e61cfc247570d9 Mon Sep 17 00:00:00 2001 From: firleju Date: Wed, 9 Nov 2016 16:20:52 +0100 Subject: [PATCH] =?UTF-8?q?Poprawka=20na=20pusty=20rozk=C5=82ad.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mtable.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mtable.cpp b/mtable.cpp index 07fea6a2..bef6c729 100644 --- a/mtable.cpp +++ b/mtable.cpp @@ -230,7 +230,7 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax) else { /*analiza rozkładu jazdy*/ ConversionError = 0; - while (!(fin.bad() || (ConversionError != 0) || EndTable)) + while (fin.good() && !((ConversionError != 0) || EndTable)) { std::getline(fin,lines); /*wczytanie linii*/ if (lines.find("___________________") != std::string::npos) /*linia pozioma górna*/ @@ -246,6 +246,11 @@ bool TTrainParameters::LoadTTfile(std::string scnpath, int iPlus, double vmax) } while (!(s == "|") || (fin.eof())); /*środkowy pion*/ } } + else if (lines == "") + { + fin.close(); + break; + } fin >> s; /*nazwa pociągu*/ // if LowerCase(s)<>ExtractFileName(TrainName) then {musi być taka sama, jak nazwa // pliku}