fix a regression in parsing when a link contains () + minor style fix - smu - s… | |
git clone git://git.codemadness.org/smu | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 0c366f57600669cba8cff413d080f58304073a3f | |
parent 743f6ce00b472c6e7694b5d3c02eb73cbccaf223 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Tue, 11 May 2021 17:44:08 +0200 | |
fix a regression in parsing when a link contains () + minor style fix | |
Diffstat: | |
M smu.c | 14 +++++++------- | |
1 file changed, 7 insertions(+), 7 deletions(-) | |
--- | |
diff --git a/smu.c b/smu.c | |
@@ -33,8 +33,8 @@ static int doshortlink(const char *begin, const char *end, in… | |
static int dosurround(const char *begin, const char *end, int newblock); /* P… | |
static int dounderline(const char *begin, const char *end, int newblock); /* P… | |
static void *ereallocz(void *p, size_t size); | |
-static void hprint(const char *begin, const char *end); /* e… | |
-static void hprintattr(const char *begin, const char *end); … | |
+static void hprint(const char *begin, const char *end); /* E… | |
+static void hprintattr(const char *begin, const char *end); /* E… | |
static void process(const char *begin, const char *end, int isblock); /* P… | |
/* list of parsers */ | |
@@ -298,15 +298,15 @@ dolink(const char *begin, const char *end, int newblock) | |
linkend--; | |
} else { | |
/* trim leading spaces */ | |
- for (p = link; p < end && isspace((unsigned char)*p); p++) | |
+ for (p = link; p < q && isspace((unsigned char)*p); p++) | |
; | |
- for (link = p; p < end; p++) { | |
+ for (link = p; p < q; p++) { | |
if (isspace((unsigned char)*p)) { | |
linkend = p; | |
break; | |
} | |
} | |
- for (; p < end; p++) { | |
+ for (; p < q; p++) { | |
if (isspace((unsigned char)*p)) | |
continue; | |
if (*p == '=') { | |
@@ -320,8 +320,8 @@ dolink(const char *begin, const char *end, int newblock) | |
sep = *p; | |
title = ++p; | |
if ((titleend = strchr(title, sep))) { | |
- if (titleend >= end) | |
- titleend = end; | |
+ if (titleend >= q) | |
+ titleend = q; | |
else | |
p = titleend; | |
} |