[ntp:bk-ntp-dev-send] BitKeeper diffs

Harlan Stenn stenn at whimsy.udel.edu
Fri Jun 1 18:30:59 PDT 2007


#### ChangeSet ####
2007-06-01 18:30:18-04:00, neal at pogo.udel.edu 
  ntp_scanner.c, ChangeLog:
    [Bug 828] refid not being parsed correctly.

==== ChangeLog ====
2007-06-01 18:27:30-04:00, neal at pogo.udel.edu +1 -0
  [Bug 828] refid not being parsed correctly.

--- 1.61/ChangeLog	2007-06-01 08:14:32 -04:00
+++ 1.62/ChangeLog	2007-06-01 18:27:30 -04:00
@@ -1,3 +1,4 @@
+* [Bug 828] refid string not being parsed correctly.
 * [Bug 846] Correct includefile parsing.
 * [Bug 827] New parsing code does not handle "fudge" correctly.
 * Enable debugging capability in the config parser.

==== ntpd/ntp_scanner.c ====
2007-06-01 18:26:56-04:00, neal at pogo.udel.edu +8 -6
  [Bug 828] refid not being parsed correctly.

--- 1.6/ntpd/ntp_scanner.c	2007-06-01 07:51:45 -04:00
+++ 1.7/ntpd/ntp_scanner.c	2007-06-01 18:26:56 -04:00
@@ -505,7 +505,7 @@ static int is_EOC(char ch)
 
 int yylex()
 {
-    int i;
+    int i, instring = 0;
     int token;                 /* The return value/the recognized token */
     int ch;
     static int expect_string = NO_ARG;
@@ -558,6 +558,7 @@ int yylex()
 	 * If we make it to EOL without a terminating " assume it for them.
 	 */
 	 if (yytext[i] == '"') {
+         instring = 1;
              while ((yytext[i] = get_next_char()) != EOF &&
                      yytext[i] != '"' && yytext[i] != '\n') {
 			i++;
@@ -583,10 +584,10 @@ int yylex()
 #endif
 
     /* Now return the desired token */
-    if ((expect_string == NO_ARG) && 
+    if ((expect_string == NO_ARG) &&  (!instring) &&
         (token = is_keyword(yytext, &expect_string)))
         return token;
-    else if (is_integer(yytext)) {
+    else if (is_integer(yytext) && (!instring) ) {
         errno = 0;
         if ((yylval.Integer = strtol(yytext,(char **) NULL, 10)) == 0
             && ((errno == EINVAL) || (errno == ERANGE))) {
@@ -597,7 +598,7 @@ int yylex()
         else
             return T_Integer;
     }
-    else if (is_double(yytext)) {
+    else if (is_double(yytext) && (!instring)) {
         errno = 0;
         if ((yylval.Double = atof(yytext)) == 0 && errno == ERANGE) {
             fprintf(stderr, "Double too large to represent: %s\n",
@@ -607,7 +608,7 @@ int yylex()
         else
             return T_Double;
     }
-    else if (is_ipv4_address(yytext)) {
+    else if (is_ipv4_address(yytext) && (!instring)) {
         if (expect_string == SINGLE_ARG)
             expect_string = NO_ARG;
         errno = 0;
@@ -620,7 +621,7 @@ int yylex()
         else
             return T_IPv4_address;
     }
-    else if (is_ipv6_address(yytext)) {
+    else if (is_ipv6_address(yytext) && (!instring)) {
         if (expect_string == SINGLE_ARG)
             expect_string = NO_ARG;
         errno = 0;
@@ -634,6 +635,7 @@ int yylex()
             return T_IPv6_address;
     }
     else { /* Default: Everything is a string */
+        instring = 0;
         if (expect_string == SINGLE_ARG)
             expect_string = NO_ARG;
         errno = 0;

#### ChangeSet ####
2007-06-01 08:13:55-04:00, neal at pogo.udel.edu 
  commit to correct bk merge problems.

==== ChangeLog ====
2007-06-01 08:12:49-04:00, neal at pogo.udel.edu +1 -0

--- 1.59.1.1/ChangeLog	2007-06-01 07:50:05 -04:00
+++ 1.59.1.2/ChangeLog	2007-06-01 08:12:49 -04:00
@@ -1,4 +1,5 @@
 * [Bug 846] Correct includefile parsing.
+* [Bug 827] New parsing code does not handle "fudge" correctly.
 * Enable debugging capability in the config parser.
 * [Bug 839] Crypto password not read from ntp.conf.
 * Have autogen produce writable output files.

#### ChangeSet ####
2007-06-01 07:52:58-04:00, neal at pogo.udel.edu 
  ntp_parser.y, ntp_scanner.c, ChangeLog:
    [Bug 846] Correct includefile parsing.

==== ChangeLog ====
2007-06-01 07:50:05-04:00, neal at pogo.udel.edu +1 -0
  [Bug 846] Correct includefile parsing.

--- 1.59/ChangeLog	2007-05-31 01:31:53 -04:00
+++ 1.59.1.1/ChangeLog	2007-06-01 07:50:05 -04:00
@@ -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.

==== ntpd/ntp_parser.y ====
2007-06-01 07:51:22-04:00, neal at pogo.udel.edu +2 -2
  [Bug 846] Correct includefile parsing.

--- 1.6/ntpd/ntp_parser.y	2007-05-30 22:54:20 -04:00
+++ 1.7/ntpd/ntp_parser.y	2007-06-01 07:51:22 -04:00
@@ -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 

==== ntpd/ntp_scanner.c ====
2007-06-01 07:51:45-04:00, neal at pogo.udel.edu +7 -2
  [Bug 846] Correct includefile parsing.

--- 1.5/ntpd/ntp_scanner.c	2007-05-29 13:22:33 -04:00
+++ 1.6/ntpd/ntp_scanner.c	2007-06-01 07:51:45 -04:00
@@ -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;
         }


More information about the bk-ntp-dev-send mailing list