[Bug 846] Correct includefile parsing.
bk: 4660089a5GU8J6iZ9YpqK7FwtdnTEA
+* [Bug 846] Correct includefile parsing.
* Enable debugging capability in the config parser.
* [Bug 839] Crypto password not read from ntp.conf.
* Have autogen produce writable output files.
*/
miscellaneous_command
- : T_Includefile T_String
+ : T_Includefile T_String command
{
if (curr_include_level >= MAXINCLUDELEVEL) {
fprintf(stderr, "getconfig: Maximum include file level exceeded.\n");
msyslog(LOG_INFO, "getconfig: Couldn't open <%s>", FindConfig($2));
}
else
- ++curr_include_level;
+ ip_file = fp[++curr_include_level];
}
}
| T_End
!is_EOC(ch))
; /* Null Statement */
- if (ch == EOF)
+ if (ch == EOF) {
+ if (curr_include_level == 0) {
return 0;
- else if (is_EOC(ch)) {
+ } else {
+ ip_file = fp[--curr_include_level];
+ return T_EOC;
+ }
+ } else if (is_EOC(ch)) {
expect_string = NO_ARG; /* Reset expect_string */
return T_EOC;
}