=================================================================== RCS file: /cvs/mandoc/roff.c,v retrieving revision 1.395 retrieving revision 1.397 diff -u -p -r1.395 -r1.397 --- mandoc/roff.c 2022/08/16 17:30:11 1.395 +++ mandoc/roff.c 2023/10/21 17:10:18 1.397 @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.395 2022/08/16 17:30:11 schwarze Exp $ */ +/* $Id: roff.c,v 1.397 2023/10/21 17:10:18 schwarze Exp $ */ /* * Copyright (c) 2010-2015, 2017-2022 Ingo Schwarze * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons @@ -1387,7 +1387,7 @@ roff_expand(struct roff *r, struct buf *buf, int ln, i */ if (buf->buf[pos] != ec) { - if (ec != ASCII_ESC && buf->buf[pos] == '\\') { + if (buf->buf[pos] == '\\') { roff_expand_patch(buf, pos, "\\e", pos + 1); pos++; } @@ -1449,7 +1449,7 @@ roff_expand(struct roff *r, struct buf *buf, int ln, i break; /* - * If not overriden, + * If not overridden, * let \*(.T through to the formatters. */ @@ -1632,12 +1632,7 @@ roff_getarg(struct roff *r, char **cpp, int ln, int *p cp++; break; case '\\': - /* - * Signal to roff_expand() that an escape - * sequence resulted from copy-in processing - * and needs to be checked or interpolated. - */ - cp[-pairs] = ASCII_ESC; + cp[-pairs] = '\\'; newesc = 1; pairs++; cp++; @@ -1694,7 +1689,7 @@ roff_getarg(struct roff *r, char **cpp, int ln, int *p buf.buf = start; buf.sz = strlen(start) + 1; buf.next = NULL; - if (roff_expand(r, &buf, ln, 0, ASCII_ESC) & ROFF_IGN) { + if (roff_expand(r, &buf, ln, 0, '\\') & ROFF_IGN) { free(buf.buf); buf.buf = mandoc_strdup(""); } @@ -2479,7 +2474,7 @@ roff_getnum(const char *v, int *pos, int *res, int fla * Evaluate a string comparison condition. * The first character is the delimiter. * Succeed if the string up to its second occurrence - * matches the string up to its third occurence. + * matches the string up to its third occurrence. * Advance the cursor after the third occurrence * or lacking that, to the end of the line. */ @@ -4371,7 +4366,7 @@ roff_getformat(const struct roff *r) * return zero and don't change the current position. * If the control character has been set with `.cc', then let that grain * precedence. - * This is slighly contrary to groff, where using the non-breaking + * This is slightly contrary to groff, where using the non-breaking * control character when `cc' has been invoked will cause the * non-breaking macro contents to be printed verbatim. */