]> git.cameronkatri.com Git - mandoc.git/blobdiff - eqn_term.c
Avoid warning "unused variable" when compiling without HAVE_WCHAR.
[mandoc.git] / eqn_term.c
index 010a152e2567a46dd1b9ede7cb84a29977db57c1..5f2818b4052b4d68f17a8d7e64c59edd56de0a46 100644 (file)
@@ -1,7 +1,7 @@
-/*     $Id: eqn_term.c,v 1.7 2014/10/12 14:49:39 schwarze Exp $ */
+/*     $Id: eqn_term.c,v 1.8 2015/01/01 15:36:08 schwarze Exp $ */
 /*
  * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -79,14 +79,17 @@ eqn_box(struct termp *p, const struct eqn_box *bp)
                     bp->pos == EQNPOS_TO) ? "^" : "_");
                p->flags |= TERMP_NOSPACE;
                child = child->next;
-               eqn_box(p, child);
-               if (bp->pos == EQNPOS_FROMTO ||
-                   bp->pos == EQNPOS_SUBSUP) {
-                       p->flags |= TERMP_NOSPACE;
-                       term_word(p, "^");
-                       p->flags |= TERMP_NOSPACE;
-                       child = child->next;
+               if (child != NULL) {
                        eqn_box(p, child);
+                       if (bp->pos == EQNPOS_FROMTO ||
+                           bp->pos == EQNPOS_SUBSUP) {
+                               p->flags |= TERMP_NOSPACE;
+                               term_word(p, "^");
+                               p->flags |= TERMP_NOSPACE;
+                               child = child->next;
+                               if (child != NULL)
+                                       eqn_box(p, child);
+                       }
                }
        } else {
                child = bp->first;