]> git.cameronkatri.com Git - mandoc.git/commitdiff
Purge duplicate error reporting from the .tr request parser:
authorIngo Schwarze <schwarze@openbsd.org>
Tue, 7 Jun 2022 09:41:59 +0000 (09:41 +0000)
committerIngo Schwarze <schwarze@openbsd.org>
Tue, 7 Jun 2022 09:41:59 +0000 (09:41 +0000)
the error was already reported earlier when roff_expand()
called roff_escape().

roff.c

diff --git a/roff.c b/roff.c
index b78ef59ee3245fb9e6e4c0cbdde5911512ee7ea4..ee0da3e6244e7ed2b19f3d85f03461463c9f9743 100644 (file)
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.393 2022/06/03 12:15:55 schwarze Exp $ */
+/* $Id: roff.c,v 1.394 2022/06/07 09:41:59 schwarze Exp $ */
 /*
  * Copyright (c) 2010-2015, 2017-2022 Ingo Schwarze <schwarze@openbsd.org>
  * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -3740,7 +3740,6 @@ roff_tr(ROFF_ARGS)
 {
        const char      *p, *first, *second;
        size_t           fsz, ssz;
-       enum mandoc_esc  esc;
 
        p = buf->buf + pos;
 
@@ -3754,23 +3753,15 @@ roff_tr(ROFF_ARGS)
 
                first = p++;
                if (*first == '\\') {
-                       esc = mandoc_escape(&p, NULL, NULL);
-                       if (esc == ESCAPE_ERROR) {
-                               mandoc_msg(MANDOCERR_ESC_BAD, ln,
-                                   (int)(p - buf->buf), "%s", first);
+                       if (mandoc_escape(&p, NULL, NULL) == ESCAPE_ERROR)
                                return ROFF_IGN;
-                       }
                        fsz = (size_t)(p - first);
                }
 
                second = p++;
                if (*second == '\\') {
-                       esc = mandoc_escape(&p, NULL, NULL);
-                       if (esc == ESCAPE_ERROR) {
-                               mandoc_msg(MANDOCERR_ESC_BAD, ln,
-                                   (int)(p - buf->buf), "%s", second);
+                       if (mandoc_escape(&p, NULL, NULL) == ESCAPE_ERROR)
                                return ROFF_IGN;
-                       }
                        ssz = (size_t)(p - second);
                } else if (*second == '\0') {
                        mandoc_msg(MANDOCERR_TR_ODD, ln,