From 1cb587dc9cc4823efd6554322e173382a120664d Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Wed, 29 Oct 2014 12:22:32 +0000 Subject: [PATCH] Fix iscsictl(8) and ctld(8) to correctly handle Windows newlines (CRLF) in iscsi.conf and ctl.conf. MFC after: 1 month Sponsored by: The FreeBSD Foundation --- usr.bin/iscsictl/token.l | 1 + usr.sbin/ctld/token.l | 1 + 2 files changed, 2 insertions(+) diff --git a/usr.bin/iscsictl/token.l b/usr.bin/iscsictl/token.l index 4866c1313a40..06af16773854 100644 --- a/usr.bin/iscsictl/token.l +++ b/usr.bin/iscsictl/token.l @@ -90,6 +90,7 @@ chapDigest { return IGNORED; } = { return EQUALS; } ; { return SEMICOLON; } #.*$ /* ignore comments */; +\r\n { lineno++; } \n { lineno++; } [ \t]+ /* ignore whitespace */; . { yylval.str = strdup(yytext); return STR; } diff --git a/usr.sbin/ctld/token.l b/usr.sbin/ctld/token.l index b63ce421a8b1..822d1ac7e333 100644 --- a/usr.sbin/ctld/token.l +++ b/usr.sbin/ctld/token.l @@ -82,6 +82,7 @@ timeout { return TIMEOUT; } \{ { return OPENING_BRACKET; } \} { return CLOSING_BRACKET; } #.*$ /* ignore comments */; +\r\n { lineno++; } \n { lineno++; } ; { return SEMICOLON; } [ \t]+ /* ignore whitespace */;