]> git.cameronkatri.com Git - mandoc.git/blobdiff - roff.c
Note that archives are being hosted at gmane.
[mandoc.git] / roff.c
diff --git a/roff.c b/roff.c
index 2e2a52a69aa6e3490258248b54b14bfe795ca63c..b479cc298cff9ebcdc1d53227ddf7a199fd385a3 100644 (file)
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/*     $Id: roff.c,v 1.171 2011/09/19 08:34:45 schwarze Exp $ */
+/*     $Id: roff.c,v 1.172 2011/10/24 21:41:45 schwarze Exp $ */
 /*
  * Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -186,7 +186,7 @@ static      void             roff_openeqn(struct roff *, const char *,
                                int, int, const char *);
 static enum rofft       roff_parse(struct roff *, const char *, int *);
 static enum rofferr     roff_parsetext(char *);
-static void             roff_res(struct roff *, 
+static enum rofferr     roff_res(struct roff *, 
                                char **, size_t *, int, int);
 static enum rofferr     roff_rm(ROFF_ARGS);
 static void             roff_setstr(struct roff *,
@@ -432,7 +432,7 @@ roff_alloc(struct mparse *parse)
  * is processed. 
  * This also checks the syntax of regular escapes.
  */
-static void
+static enum rofferr
 roff_res(struct roff *r, char **bufp, size_t *szp, int ln, int pos)
 {
        enum mandoc_esc  esc;
@@ -458,7 +458,7 @@ again:
                 */
 
                if ('\0' == *cp)
-                       return;
+                       return(ROFF_CONT);
 
                if ('*' != *cp) {
                        res = cp;
@@ -469,7 +469,7 @@ again:
                        mandoc_msg
                                (MANDOCERR_BADESCAPE, r->parse, 
                                 ln, (int)(stesc - *bufp), NULL);
-                       return;
+                       return(ROFF_CONT);
                }
 
                cp++;
@@ -482,7 +482,7 @@ again:
 
                switch (*cp) {
                case ('\0'):
-                       return;
+                       return(ROFF_CONT);
                case ('('):
                        cp++;
                        maxl = 2;
@@ -505,7 +505,7 @@ again:
                                        (MANDOCERR_BADESCAPE, 
                                         r->parse, ln, 
                                         (int)(stesc - *bufp), NULL);
-                               return;
+                               return(ROFF_CONT);
                        }
                        if (0 == maxl && ']' == *cp)
                                break;
@@ -546,8 +546,9 @@ again:
 
                /* Just leave the string unexpanded. */
                mandoc_msg(MANDOCERR_ROFFLOOP, r->parse, ln, pos, NULL);
-               return;
+               return(ROFF_IGN);
        }
+       return(ROFF_CONT);
 }
 
 /*
@@ -604,7 +605,10 @@ roff_parseln(struct roff *r, int ln, char **bufp,
         * words to fill in.
         */
 
-       roff_res(r, bufp, szp, ln, pos);
+       e = roff_res(r, bufp, szp, ln, pos);
+       if (ROFF_IGN == e)
+               return(e);
+       assert(ROFF_CONT == e);
 
        ppos = pos;
        ctl = mandoc_getcontrol(*bufp, &pos);