EOF
[m6w6/ext-psi] / src / context.c
index 05d5aacbfc3d1d041957d88b72df257ee35e47f5..cbcfbc6b1d6ecd6e32ab0a2a099cf557cad958f1 100644 (file)
@@ -960,9 +960,13 @@ void PSI_ContextBuild(PSI_Context *C, const char *paths)
                                        continue;
                                }
 
                                        continue;
                                }
 
-                               while (-1 != PSI_ParserScan(&P)) {
+                               while (0 < PSI_ParserScan(&P)) {
                                        PSI_ParserParse(&P, PSI_TokenAlloc(&P));
                                        PSI_ParserParse(&P, PSI_TokenAlloc(&P));
-                               };
+                                       if (P.num == PSI_T_EOF) {
+                                               break;
+                                       }
+                               }
+
                                PSI_ParserParse(&P, NULL);
                                PSI_ContextValidate(C, &P);
                                PSI_ParserDtor(&P);
                                PSI_ParserParse(&P, NULL);
                                PSI_ContextValidate(C, &P);
                                PSI_ParserDtor(&P);