summaryrefslogtreecommitdiff
path: root/smu.c
diff options
context:
space:
mode:
Diffstat (limited to 'smu.c')
-rw-r--r--smu.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/smu.c b/smu.c
index 43bd011..4aaf9db 100644
--- a/smu.c
+++ b/smu.c
@@ -444,11 +444,10 @@ dosurround(const char *begin, const char *end, int newblock) {
do {
p = strstr(p + 1, surround[i].search);
} while(p && p[-1] == '\\');
- if(!p || p >= end)
+ if(!p || p >= end ||
+ !(stop = strstr(start, surround[i].search)) || stop >= end)
continue;
fputs(surround[i].before, stdout);
- if(!(stop = strstr(start, surround[i].search)) || stop >= end)
- continue;
if(surround[i].process)
process(start, stop, 0);
else