]> code.citadel.org Git - citadel.git/commitdiff
* look for | as url terminator too if we found an [ as opener.
authorWilfried Göesgens <willi@citadel.org>
Sun, 1 Apr 2007 20:54:03 +0000 (20:54 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 1 Apr 2007 20:54:03 +0000 (20:54 +0000)
webcit/messages.c

index 3bba9f7e95d672cf613a9d566510272486a24640..640c5d32219564c2b3f9e49073f2fdda76451d74 100644 (file)
@@ -254,13 +254,14 @@ void url(char *buf)
 
        int pos;
        int start, end;
-       char ench;
+       char ench, eench;
        char urlbuf[SIZ];
        char outbuf[1024];
 
        start = (-1);
        end = strlen(buf);
        ench = 0;
+       eench = 0;
 
        for (pos = 0; pos < strlen(buf); ++pos) {
                if (!strncasecmp(&buf[pos], "http://", 7))
@@ -274,15 +275,19 @@ void url(char *buf)
 
        if ((start > 0) && (buf[start - 1] == '<'))
                ench = '>';
-       if ((start > 0) && (buf[start - 1] == '['))
-               ench = ']';
        if ((start > 0) && (buf[start - 1] == '('))
                ench = ')';
        if ((start > 0) && (buf[start - 1] == '{'))
                ench = '}';
+       if ((start > 0) && (buf[start - 1] == '[')) {
+               ench = ']';
+               eench = '|';
+       }
 
        for (pos = strlen(buf); pos > start; --pos) {
-               if ((buf[pos] == ' ') || (buf[pos] == ench))
+               if ((buf[pos] == ' ')  || 
+                   (buf[pos] == ench) ||
+                   (buf[pos] == eench))
                        end = pos;
        }