| @@ -26,27 +26,27 @@ | | | @@ -26,27 +26,27 @@ |
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | | 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
31 | * THE POSSIBILITY OF SUCH DAMAGE. | | 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
32 | */ | | 32 | */ |
33 | | | 33 | |
34 | #include <sys/cdefs.h> | | 34 | #include <sys/cdefs.h> |
35 | #ifdef __FreeBSD__ | | 35 | #ifdef __FreeBSD__ |
36 | __FBSDID("$FreeBSD: src/usr.sbin/ndiscvt/inf-token.l,v 1.3 2004/01/11 21:10:35 mdodd Exp $"); | | 36 | __FBSDID("$FreeBSD: src/usr.sbin/ndiscvt/inf-token.l,v 1.3 2004/01/11 21:10:35 mdodd Exp $"); |
37 | #endif | | 37 | #endif |
38 | #ifdef __NetBSD__ | | 38 | #ifdef __NetBSD__ |
39 | __RCSID("$NetBSD: inf-token.l,v 1.8 2009/10/29 14:49:03 christos Exp $"); | | 39 | __RCSID("$NetBSD: inf-token.l,v 1.9 2011/06/09 13:09:42 joerg Exp $"); |
40 | #endif | | 40 | #endif |
41 | | | 41 | |
42 | #include <regex.h> | | 42 | #include <regex.h> |
43 | #include <ctype.h> | | 43 | #include <ctype.h> |
44 | #include <err.h> | | 44 | #include <err.h> |
45 | #include <stdio.h> | | 45 | #include <stdio.h> |
46 | #include <stdlib.h> | | 46 | #include <stdlib.h> |
47 | #include <string.h> | | 47 | #include <string.h> |
48 | #include "inf-parse.h" | | 48 | #include "inf-parse.h" |
49 | | | 49 | |
50 | int lineno = 1; | | 50 | int lineno = 1; |
51 | | | 51 | |
52 | int input_is_unicode = 0; | | 52 | int input_is_unicode = 0; |
| @@ -61,27 +61,27 @@ int yylex(void); | | | @@ -61,27 +61,27 @@ int yylex(void); |
61 | void ndiscvt_error(const char *); | | 61 | void ndiscvt_error(const char *); |
62 | int ndiscvt_wrap(void); | | 62 | int ndiscvt_wrap(void); |
63 | | | 63 | |
64 | static void | | 64 | static void |
65 | update_lineno(const char *cp) | | 65 | update_lineno(const char *cp) |
66 | { | | 66 | { |
67 | while (*cp) | | 67 | while (*cp) |
68 | if (*cp++ == '\n') | | 68 | if (*cp++ == '\n') |
69 | lineno++; | | 69 | lineno++; |
70 | } | | 70 | } |
71 | | | 71 | |
72 | %} | | 72 | %} |
73 | | | 73 | |
74 | %option nounput | | 74 | %option nounput noinput |
75 | | | 75 | |
76 | %% | | 76 | %% |
77 | | | 77 | |
78 | [ \t]+ ; | | 78 | [ \t]+ ; |
79 | \n { lineno++; return EOL; } | | 79 | \n { lineno++; return EOL; } |
80 | \r ; | | 80 | \r ; |
81 | ;.*$ ; | | 81 | ;.*$ ; |
82 | \/\/.*$ ; | | 82 | \/\/.*$ ; |
83 | = { return EQUALS; } | | 83 | = { return EQUALS; } |
84 | , { return COMMA; } | | 84 | , { return COMMA; } |
85 | \"(\\\"|[^"]|\"\")*\" { | | 85 | \"(\\\"|[^"]|\"\")*\" { |
86 | int len = strlen(yytext) - 2; | | 86 | int len = strlen(yytext) - 2; |
87 | int blen = len + 1; | | 87 | int blen = len + 1; |