From 76953aa1a56b336a3566fa5c06766b7112de9900 Mon Sep 17 00:00:00 2001 From: Cormac Stephenson Date: Thu, 18 Mar 2021 00:02:48 +0000 Subject: [PATCH] Escape ' at the beginning of lines --- src/main.c | 10 ++++++++++ diff --git a/src/main.c b/src/main.c index cc104f177a4cbfb57d86755d1de3ccd45df42150..d90681df2495877ffc19f7ce671a27004e4c5f6c 100644 --- a/src/main.c +++ b/src/main.c @@ -248,6 +248,13 @@ fprintf(p->output, "\\&.\\&"); break; } /* fallthrough */ + case '\'': + if (!i) { + // Escape ' if it's the first character + fprintf(p->output, "\\&'\\&"); + break; + } + /* fallthrough */ case '!': case '?': last = ch; @@ -424,6 +431,9 @@ } switch (ch) { case '.': fprintf(p->output, "\\&."); + break; + case '\'': + fprintf(p->output, "\\&'"); break; case '\\': ch = parser_getch(p); -- 2.48.1