]> git.cameronkatri.com Git - mandoc.git/blobdiff - mandoc.c
Added mail archive periodically generated by hypermail.
[mandoc.git] / mandoc.c
index 69972c04dd560997ddcadd3ceaf46b31adb8b884..7bba8cbb6878a3df4a957146d9fcb2b330d45478 100644 (file)
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/*     $Id: mandoc.c,v 1.25 2010/07/21 20:35:03 kristaps Exp $ */
+/*     $Id: mandoc.c,v 1.28 2010/08/16 09:37:58 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
  *
@@ -57,8 +57,6 @@ mandoc_special(char *p)
                /* FALLTHROUGH */
        case ('w'):
                /* FALLTHROUGH */
-       case ('v'):
-               /* FALLTHROUGH */
        case ('S'):
                /* FALLTHROUGH */
        case ('R'):
@@ -91,13 +89,19 @@ mandoc_special(char *p)
                term = '\'';
                break;
 #endif
+       case ('h'):
+               /* FALLTHROUGH */
+       case ('v'):
+               /* FALLTHROUGH */
        case ('s'):
                if (ASCII_HYPH == *p)
                        *p = '-';
-               if ('+' == *p || '-' == *p)
-                       p++;
 
-               i = ('s' != *(p - 1));
+               i = 0;
+               if ('+' == *p || '-' == *p) {
+                       p++;
+                       i = 1;
+               }
 
                switch (*p++) {
                case ('('):
@@ -109,6 +113,9 @@ mandoc_special(char *p)
                case ('\''):
                        term = '\'';
                        break;
+               case ('0'):
+                       i = 1;
+                       /* FALLTHROUGH */
                default:
                        len = 1;
                        p--;
@@ -118,13 +125,11 @@ mandoc_special(char *p)
                if (ASCII_HYPH == *p)
                        *p = '-';
                if ('+' == *p || '-' == *p) {
-                       if (i++)
+                       if (i)
                                return(0);
                        p++;
                } 
                
-               if (0 == i)
-                       return(0);
                break;
 #if 0
        case ('Y'):
@@ -334,7 +339,7 @@ mandoc_eos(const char *p, size_t sz, int enclosed)
                        found = 1;
                        break;
                default:
-                       return(found && (!enclosed || isalnum(*q)));
+                       return(found && (!enclosed || isalnum((unsigned char)*q)));
                }
        }