apt_loader.cxx: update version parsing to 4-digit versions,
some tweaks according to the spec.
This commit is contained in:
parent
b71e703d75
commit
6ffdb1bc54
1 changed files with 8 additions and 8 deletions
|
@ -105,7 +105,7 @@ public:
|
||||||
line = tmp; // string copy, ack
|
line = tmp; // string copy, ack
|
||||||
line_num++;
|
line_num++;
|
||||||
|
|
||||||
if ( !line.size() || isspace(tmp[0])) {
|
if ( line.empty() || isspace(tmp[0]) || tmp[0] == '#' ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,16 +116,16 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
line_id = atoi(tmp);
|
line_id = atoi(tmp);
|
||||||
if ( tmp[0] == 'I' ) {
|
if ( tmp[0] == 'I' || tmp[0] == 'A' ) {
|
||||||
// First line, indicates IBM (i.e. DOS line endings I
|
// First line, indicates IBM ("I") or Macintosh ("A")
|
||||||
// believe.)
|
// line endings.
|
||||||
|
|
||||||
// move past this line and read and discard the next line
|
// move past this line and read and discard the next line
|
||||||
// which is the version and copyright information
|
// which is the version and copyright information
|
||||||
in.getline(tmp, 2048);
|
in.getline(tmp, 2048);
|
||||||
// vector<string> vers_token = simgear::strutils::split( tmp );
|
|
||||||
if ( strlen(tmp) > 4 ) {
|
if ( strlen(tmp) > 5 ) {
|
||||||
char *p = (char *)memchr(tmp, ' ', 4);
|
char *p = (char *)memchr(tmp, ' ', 5);
|
||||||
if ( p )
|
if ( p )
|
||||||
*p = 0;
|
*p = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue