summaryrefslogtreecommitdiff
path: root/ui/text_import_scanner.l
diff options
context:
space:
mode:
authorVasil Velichckov <vvvelichkov@gmail.com>2016-01-14 17:55:51 +0200
committerAnders Broman <a.broman58@gmail.com>2016-02-04 05:13:16 +0000
commitd5c1449d1b7ae0a2a04e401f9015a516ba7201f9 (patch)
treeb135127e4533399a59e5db30a7377ca73bc21992 /ui/text_import_scanner.l
parentf6ff90fed6b18af3885d2cd66452004977cbcf24 (diff)
downloadwireshark-d5c1449d1b7ae0a2a04e401f9015a516ba7201f9.tar.gz
[text2pcap] Fix parsing of hash sign at the end of the line
Change-Id: I4ff1ef28aba353fd7548cb5c0603fc29479aa854 Reviewed-on: https://code.wireshark.org/review/13294 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/text_import_scanner.l')
-rw-r--r--ui/text_import_scanner.l8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/text_import_scanner.l b/ui/text_import_scanner.l
index 23e6d24adb..9af93643e4 100644
--- a/ui/text_import_scanner.l
+++ b/ui/text_import_scanner.l
@@ -73,8 +73,8 @@
%}
hexdigit [0-9A-Fa-f]
-directive #TEXT2PCAP.*
-comment #[^W].*
+directive ^#TEXT2PCAP.*\r?\n
+comment ^[\t ]*#.*\r?\n
byte [0-9A-Fa-f][0-9A-Fa-f][ \t]
byte_eol [0-9A-Fa-f][0-9A-Fa-f]\r?\n
offset [0-9A-Fa-f]+[: \t]
@@ -92,8 +92,8 @@ eol \r?\n\r?
{mailfwd}{offset} { parse_token(T_OFFSET, yytext+1); }
{eol} { parse_token(T_EOL, NULL); }
[ \t] ; /* ignore whitespace */
-{directive} { parse_token(T_DIRECTIVE, yytext); }
-{comment} ; /* ignore comments */
+{directive} { parse_token(T_DIRECTIVE, yytext); parse_token(T_EOL, NULL); }
+{comment} { parse_token(T_EOL, NULL); }
{text} { parse_token(T_TEXT, yytext); }
<<EOF>> { write_current_packet(); yyterminate(); }