aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-06-10 23:42:41 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-06-10 23:42:41 +0200
commite041465496da0026501177725d6435d823244fe6 (patch)
treeef66ae5e9ea458afb2a8c4dcfe913d83a598818f
parentd8ab4168b1dc4e56c51c17a5c68c34df3014aeec (diff)
downloadlightroff-e041465496da0026501177725d6435d823244fe6.tar.gz
Handle newlines at beginning of file.
-rw-r--r--xroff.lex3
1 files changed, 2 insertions, 1 deletions
diff --git a/xroff.lex b/xroff.lex
index 72ab379..9326415 100644
--- a/xroff.lex
+++ b/xroff.lex
@@ -8,9 +8,10 @@
%%
\\ BEGIN(ESC);
+^\n* /* Ignore newlines at beginning of file. */
\n BEGIN(NEW);
\<!\[ BEGIN(RAW);
-\<!--.*--> /* Ignore comment. */
+\<!--.*-->\n* /* Ignore comment. */
^< printf("."); BEGIN(REQ); /* Beginning of file. */
\< printf("\\c\n."); BEGIN(REQ);
. ECHO;