preventing from unwanted output. - smu - smu - simple markup (Markdown) processor (fork, fixes + features)
 (HTM) git clone git://git.codemadness.org/smu
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 2f223a46e0a0c1559c5df4851da38ac75498e1cc
 (DIR) parent fc9310966e8c38fea21fd1cfe2f3e916cbbb11b7
 (HTM) Author: gottox@work <gottox@work>
       Date:   Mon, 28 Jan 2008 14:13:58 +0100
       
       preventing from unwanted output.
       
       Diffstat:
         M smu.c                               |       5 ++---
       
       1 file changed, 2 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git 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