Don't complain about garbage if we skipped importing a host file.
This commit is contained in:
parent
c90c431bc9
commit
cad86108f3
1 changed files with 2 additions and 1 deletions
|
@ -1857,6 +1857,8 @@ static int cmd_import(int argc, char *argv[]) {
|
||||||
|
|
||||||
while(fgets(buf, sizeof buf, in)) {
|
while(fgets(buf, sizeof buf, in)) {
|
||||||
if(sscanf(buf, "Name = %s", name) == 1) {
|
if(sscanf(buf, "Name = %s", name) == 1) {
|
||||||
|
firstline = false;
|
||||||
|
|
||||||
if(!check_id(name)) {
|
if(!check_id(name)) {
|
||||||
fprintf(stderr, "Invalid Name in input!\n");
|
fprintf(stderr, "Invalid Name in input!\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1881,7 +1883,6 @@ static int cmd_import(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
firstline = false;
|
|
||||||
continue;
|
continue;
|
||||||
} else if(firstline) {
|
} else if(firstline) {
|
||||||
fprintf(stderr, "Junk at the beginning of the input, ignoring.\n");
|
fprintf(stderr, "Junk at the beginning of the input, ignoring.\n");
|
||||||
|
|
Loading…
Reference in a new issue