]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1345] illegal 'grep' option prevents compilation.
authorDave Hart <hart@ntp.org>
Thu, 15 Oct 2009 22:09:06 +0000 (22:09 +0000)
committerDave Hart <hart@ntp.org>
Thu, 15 Oct 2009 22:09:06 +0000 (22:09 +0000)
[Bug 1346] keyword scanner broken where char defaults to unsigned.
[Bug 1347] ntpd/complete.conf missing multicastclient test case.

bk: 4ad79d826ePJSWs2zWr-ExNRVkKF5w

ChangeLog
ntpd/Makefile.am
ntpd/complete.conf
ntpd/ntp_config.c
ntpd/ntp_scanner.c
ntpd/ntp_scanner.h

index eacfbcaf9d36bc54d2dff605764cbaf0b12b93bb..fb05eed91c0030bf8a92b80b55bf25b9d73113e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+* [Bug 1345] illegal 'grep' option prevents compilation.
+* [Bug 1346] keyword scanner broken where char defaults to unsigned.
+* [Bug 1347] ntpd/complete.conf missing multicastclient test case.
 (4.2.5p233-RC) 2009/10/15 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 1337] cast setsockopt() v4 address pointer to void *.
 * [Bug 1342] ignore|drop one IPv6 address on an interface blocks all
index 56e9ac43a0a2eed9fd4b4bd9d7c82214d0305e21..ee1c10ba57ba246b56fe9a03c7a105fe8157d6d8 100644 (file)
@@ -181,8 +181,8 @@ libntpd_a_SOURCES =         \
 
 ntp_keyword.out: keyword-gen
        ./keyword-gen $(srcdir)/ntp_parser.h > $@
-       grep -F -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp1
-       grep -F -v diff_ignore_line < $@ > cmp2
+       grep -v diff_ignore_line < $(srcdir)/ntp_keyword.h > cmp1
+       grep -v diff_ignore_line < $@ > cmp2
        cmp cmp1 cmp2 > /dev/null || cp $@ $(srcdir)/ntp_keyword.h
        rm cmp1 cmp2
 
index c570d2f092ba4f1849208f89ab59b1365ae2aac6..0c06f11a6ae50f0365c920caabec826206bcaf04 100644 (file)
@@ -36,6 +36,7 @@ broadcast 192.168.192.255
 manycastclient 224.0.1.1
 manycastclient ff05::101
 manycastserver 224.0.1.1 ff05::101
+multicastclient 224.0.1.1 ff05::101
 discard minimum 1 average 3 monitor 1
 restrict default nomodify limited kod
 restrict trusted.host.name.example.com. nomodify
index 114db85121a647c46359ae9c42578ee1aec3b54b..7439013c47b5682de63df4ef8d732b7e5da2bfd8 100644 (file)
@@ -912,32 +912,26 @@ dump_config_tree(
                        }
                }
        }
-       
+
        list_ptr = queue_head(ptree->manycastserver);
        if (list_ptr != NULL) {
-               addr = (struct address_node *) list_ptr;
+               addr = list_ptr;
                fprintf(df, "manycastserver %s", addr->address);
-               for (list_ptr = next_node(list_ptr);    
-                    list_ptr != NULL;
-                    list_ptr = next_node(list_ptr)) {
-
-                       addr = (struct address_node *) list_ptr;
+               for (addr = next_node(addr);
+                    addr != NULL;
+                    addr = next_node(addr))
                        fprintf(df, " %s", addr->address);
-               }
                fprintf(df, "\n");
        }
 
        list_ptr = queue_head(ptree->multicastclient);
        if (list_ptr != NULL) {
-               addr = (struct address_node *) list_ptr;
+               addr = list_ptr;
                fprintf(df, "multicastclient %s", addr->address);
-               for (list_ptr = next_node(list_ptr);    
-                    list_ptr != NULL;
-                    list_ptr = next_node(list_ptr)) {
-
-                       addr = (struct address_node *) list_ptr;
+               for (addr = next_node(addr);
+                    addr != NULL;
+                    addr = next_node(addr))
                        fprintf(df, " %s", addr->address);
-               }
                fprintf(df, "\n");
        }
 
index d424e0e81fc488d4b5d6ea01afce363755fa4796..e7da5b05fd4c1be1cf53248982d7073ec4f5f850 100644 (file)
@@ -57,7 +57,7 @@ const char special_chars[] = "{}(),;|=";
  * ---------
  */
 
-char get_next_char(void);
+int get_next_char(void);
 static int is_keyword(char *lexeme, follby *pfollowedby);
 
 
@@ -176,7 +176,7 @@ FCLOSE(
  * input_from_file flag.
  */
 
-char
+int
 get_next_char(
        void
        )
@@ -184,7 +184,7 @@ get_next_char(
        char ch;
 
        if (input_from_file)
-               return (char)FGETC(ip_file);
+               return FGETC(ip_file);
        else {
                if (remote_config.buffer[remote_config.pos] == '\0') 
                        return EOF;
@@ -474,20 +474,22 @@ yylex(
 
                /* Read in the lexeme */
                i = 0;
-               while (EOF != (yytext[i] = get_next_char())) {
+               while (EOF != (ch = get_next_char())) {
+
+                       yytext[i] = (char)ch;
 
                        /* Break on whitespace or a special character */
-                       if (isspace(yytext[i]) || is_EOC(ch) 
-                           || '"' == yytext[i]
+                       if (isspace(ch) || is_EOC(ch) 
+                           || '"' == ch
                            || (FOLLBY_TOKEN == followedby
-                               && is_special(yytext[i])))
+                               && is_special(ch)))
                                break;
 
                        /* Read the rest of the line on reading a start
                           of comment character */
-                       if ('#' == yytext[i]) {
-                               while (EOF != (yytext[i] = get_next_char())
-                                      && '\n' != yytext[i])
+                       if ('#' == ch) {
+                               while (EOF != (ch = get_next_char())
+                                      && '\n' != ch)
                                        ; /* Null Statement */
                                break;
                        }
@@ -502,11 +504,11 @@ yylex(
                 *
                 * XXX - HMS: I'm not sure we want to assume the closing "
                 */
-               if ('"' == yytext[i]) {
+               if ('"' == ch) {
                        instring = 1;
-                       while (EOF != (yytext[i] = get_next_char()) &&
-                              yytext[i] != '"' && yytext[i] != '\n') {
-                               i++;
+                       while (EOF != (ch = get_next_char()) &&
+                              ch != '"' && ch != '\n') {
+                               yytext[i++] = (char)ch;
                                if (i >= COUNTOF(yytext))
                                        goto lex_too_long;
                        }
@@ -515,8 +517,8 @@ yylex(
                         * this lexeme, but any closing quote should
                         * not be pushed back, so we read another char.
                         */
-                       if ('"' == yytext[i])
-                               yytext[i] = get_next_char();
+                       if ('"' == ch)
+                               ch = get_next_char();
                }
                /* Pushback the last character read that is not a part
                 * of this lexeme.
@@ -524,10 +526,10 @@ yylex(
                 * newline character. This is to prevent a parse error
                 * when there is no newline at the end of a file.
                 */
-               if (EOF == yytext[i])
+               if (EOF == ch)
                        push_back_char('\n');
                else
-                       push_back_char(yytext[i]); 
+                       push_back_char(ch); 
                yytext[i] = '\0';
        } while (i == 0);
 
index 8e53e13fca472533be6f2e008bb41b1f42073669..7172c89265bda6c9623b42082ea27ebb5b4ba05c 100644 (file)
@@ -76,7 +76,6 @@ struct FILE_INFO {
 /* SCANNER GLOBAL VARIABLES 
  * ------------------------
  */
-extern struct state *key_scanner; /* A FSA for recognizing keywords */
 extern struct config_tree cfgt;          /* Parser output stored here */
 extern int curr_include_level;    /* The current include level */