mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-29 20:15:54 +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 */
|
/* EndSCHEMATC */
|
||||||
|
|
||||||
if (sscanf(line, "$EndSCHEMATC%n", &n) == 0 && n)
|
if (sscanf(line, "$EndSCHEMATC%n", &n) == 0 && n) {
|
||||||
return 0;
|
ctx->state = sch_eof;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case sch_descr:
|
case sch_descr:
|
||||||
if (sscanf(line, "Title \"%m[^\"]\"", &s) == 1) {
|
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);
|
submit_obj(ctx, sch_obj_wire);
|
||||||
ctx->state = sch_basic;
|
ctx->state = sch_basic;
|
||||||
return 1;
|
return 1;
|
||||||
|
case sch_eof:
|
||||||
|
return 1;
|
||||||
default:
|
default:
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ enum sch_state {
|
|||||||
sch_sheet, /* sub-sheet */
|
sch_sheet, /* sub-sheet */
|
||||||
sch_text, /* text or label */
|
sch_text, /* text or label */
|
||||||
sch_wire, /* wire */
|
sch_wire, /* wire */
|
||||||
|
sch_eof, /* skipping anything after $EndSCHEMATC */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sheet;
|
struct sheet;
|
||||||
|
Loading…
Reference in New Issue
Block a user