]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_parser.y, ntp_scanner.c, ChangeLog:
authorRob Neal <neal@ntp.org>
Fri, 1 Jun 2007 11:52:58 +0000 (07:52 -0400)
committerRob Neal <neal@ntp.org>
Fri, 1 Jun 2007 11:52:58 +0000 (07:52 -0400)
  [Bug 846] Correct includefile parsing.

bk: 4660089a5GU8J6iZ9YpqK7FwtdnTEA

ChangeLog
ntpd/ntp_parser.y
ntpd/ntp_scanner.c

index ed855016cfef00cc1bae6caaaebd49c4ec207f84..4f4f8c79c42075fc7fa6d63eb804283bb1e18784 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [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.
index 1ca442334b29f6a79be31f6d534e879ce95ca7ee..8496ea436fb7719fb103d37a86213a107685970c 100644 (file)
@@ -717,7 +717,7 @@ tinker_option
  */
 
 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");
@@ -730,7 +730,7 @@ miscellaneous_command
                             msyslog(LOG_INFO, "getconfig: Couldn't open <%s>", FindConfig($2));
                         }
                         else
-                            ++curr_include_level;
+                            ip_file = fp[++curr_include_level];
                     }
                 }
        |       T_End 
index a07ffca3d39f900d40a65457dc65e06d9c59fef2..9e6c9c3be2a473bbb9b6fc892f7430bff9171778 100644 (file)
@@ -517,9 +517,14 @@ int yylex()
                !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;
         }