Index: src_plugins/io_pcb/parse_l.c =================================================================== --- src_plugins/io_pcb/parse_l.c (revision 8823) +++ src_plugins/io_pcb/parse_l.c (revision 8824) @@ -2465,6 +2465,10 @@ int ret; pcb_fp_fopen_ctx_t st; + f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st); + + /* set up the yy globals only after the pcb_fp_fopen() because it can + also call Parse */ yy_parse_tags = 0; yy_settings_dest = CFR_invalid; yyPCB = NULL; @@ -2473,7 +2477,6 @@ yyFontkitValid = NULL; yyElement = NULL; - f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st); if (f == NULL) return -1; Index: src_plugins/io_pcb/parse_l.l =================================================================== --- src_plugins/io_pcb/parse_l.l (revision 8823) +++ src_plugins/io_pcb/parse_l.l (revision 8824) @@ -324,6 +324,10 @@ int ret; pcb_fp_fopen_ctx_t st; + f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st); + + /* set up the yy globals only after the pcb_fp_fopen() because it can + also call Parse */ yy_parse_tags = 0; yy_settings_dest = CFR_invalid; yyPCB = NULL; @@ -332,7 +336,6 @@ yyFontkitValid = NULL; yyElement = NULL; - f = pcb_fp_fopen(pcb_fp_default_search_path(), name, &st); if (f == NULL) return -1;