From b9ec20c72974c8c5e66f152699fe2719bfd25795 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sat, 18 Dec 2021 15:59:19 -0500 Subject: [PATCH] Fix error handling on newline mid-link I forgot we have a sub-enum state for in_link rather than 'in'! --- blag.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blag.c b/blag.c index d96860f..c95f442 100644 --- a/blag.c +++ b/blag.c @@ -74,7 +74,10 @@ void handle_lf(state *s) { if (s->in == HEADER) { s->in = NONE; printf("", s->hlvl); - } else if (s->in == LINK_URL_PARSE || s->in == LINK_DESC_PARSE) { + } + + /* Guard against newlines when in parsing types */ + if (s->in_link == LINK_URL_PARSE || s->in_link == LINK_DESC_PARSE) { errx(1, "newline detected while processing link"); } -- libgit2 1.1.1