X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fcontext.c;h=1090e98f83ac830115e72d6540566eccbda0ea9d;hb=de4f7cc512bbffb5e71290ac48e659dae5e9601d;hp=3ac26c70d81e100dfb856f304a90ebb4c90f7d4c;hpb=9bcb1df0786a8193d65949c857baaba2f4296e84;p=m6w6%2Fext-psi diff --git a/src/context.c b/src/context.c index 3ac26c7..1090e98 100644 --- a/src/context.c +++ b/src/context.c @@ -250,11 +250,16 @@ void psi_context_build(struct psi_context *C, const char *paths) C->error(PSI_DATA(C), NULL, PSI_WARNING, "Path to PSI file too long: %s/%s", ptr, entries[i]->d_name); } - if (!psi_parser_init(&P, psi, C->error, C->flags)) { + if (!psi_parser_init(&P, C->error, C->flags)) { C->error(PSI_DATA(C), NULL, PSI_WARNING, "Failed to init PSI parser (%s): %s", psi, strerror(errno)); continue; } + if (!psi_parser_open_file(&P, psi)) { + C->error(PSI_DATA(C), NULL, PSI_WARNING, "Failed to open PSI file (%s): %s", + psi, strerror(errno)); + continue; + } while (0 < psi_parser_scan(&P)) { psi_parser_parse(&P, psi_token_alloc(&P));