mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-29 20:53:55 +02:00
eeshow/sch-parse.c (parse_line): no longer use return code 0 for EOF
We'll soon use it to indicate a parsing problem.
This commit is contained in:
parent
59b7946a5f
commit
e5f010797d
@ -438,8 +438,10 @@ static bool parse_line(const struct file *file, void *user, const char *line)
|
||||
|
||||
/* EndSCHEMATC */
|
||||
|
||||
if (sscanf(line, "$EndSCHEMATC%n", &n) == 0 && n)
|
||||
return 0;
|
||||
if (sscanf(line, "$EndSCHEMATC%n", &n) == 0 && n) {
|
||||
ctx->state = sch_eof;
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case sch_descr:
|
||||
if (sscanf(line, "Title \"%m[^\"]\"", &s) == 1) {
|
||||
@ -530,6 +532,8 @@ static bool parse_line(const struct file *file, void *user, const char *line)
|
||||
submit_obj(ctx, sch_obj_wire);
|
||||
ctx->state = sch_basic;
|
||||
return 1;
|
||||
case sch_eof:
|
||||
return 1;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ enum sch_state {
|
||||
sch_sheet, /* sub-sheet */
|
||||
sch_text, /* text or label */
|
||||
sch_wire, /* wire */
|
||||
sch_eof, /* skipping anything after $EndSCHEMATC */
|
||||
};
|
||||
|
||||
struct sheet;
|
||||
|
Loading…
Reference in New Issue
Block a user