mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 04:11:16 -05:00
Relax ADIF log file parsing to allow garbage between records and records with no DX callsign
This commit is contained in:
parent
784f75ea74
commit
5e585e8027
@ -320,16 +320,16 @@ namespace
|
||||
}
|
||||
}
|
||||
while ((end_position = buffer.indexOf ("<EOR>", 0, Qt::CaseInsensitive)) < 0 && !in.atEnd ());
|
||||
if (end_position < 0)
|
||||
if (end_position >= 0) // require valid ADIF record
|
||||
// with terminator
|
||||
{
|
||||
throw LoaderException (std::runtime_error {"Invalid ADIF record starting at: " + buffer.left (40).toStdString ()});
|
||||
}
|
||||
auto record = buffer.left (end_position + 5).trimmed ();
|
||||
auto next_record = buffer.indexOf (QChar {'<'}, end_position + 5);
|
||||
buffer.remove (0, next_record >=0 ? next_record : buffer.size ());
|
||||
record = record.mid (record.indexOf (QChar {'<'}));
|
||||
auto call = extractField (record, "CALL");
|
||||
if (call.size ())
|
||||
if (call.size ()) // require CALL field before we
|
||||
// will parse a record
|
||||
{
|
||||
auto const& entity = prefixes->lookup (call);
|
||||
worked.emplace (call.toUpper ()
|
||||
@ -341,9 +341,6 @@ namespace
|
||||
, entity.CQ_zone
|
||||
, entity.ITU_zone);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw LoaderException (std::runtime_error {"Invalid ADIF record with no CALL: " + record.toStdString ()});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user