From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12686 invoked from network); 18 May 2021 13:23:17 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 18 May 2021 13:23:17 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id af1a6c50 for ; Tue, 18 May 2021 08:23:13 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id 7a1cb6d8 for ; Tue, 18 May 2021 08:23:13 -0500 (EST) Date: Tue, 18 May 2021 08:23:13 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: When looking for column separators on tbl(7) data lines, X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- When looking for column separators on tbl(7) data lines, properly skip escape sequences; do not misinterpret bytes from the middle of escape sequence names or arguments as column separators. Bug reported and patch tested by Oliver dot Corff at email dot de. Modified Files: -------------- mandoc: tbl_data.c Revision Data ------------- Index: tbl_data.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/tbl_data.c,v retrieving revision 1.54 retrieving revision 1.55 diff -Ltbl_data.c -Ltbl_data.c -u -p -r1.54 -r1.55 --- tbl_data.c +++ tbl_data.c @@ -1,7 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2011,2015,2017,2018,2019 Ingo Schwarze + * Copyright (c) 2011,2015,2017-2019,2021 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -46,6 +46,7 @@ getdata(struct tbl_node *tbl, struct tbl struct tbl_dat *dat, *pdat; struct tbl_cell *cp; struct tbl_span *pdp; + const char *ccp; int sv; /* @@ -54,8 +55,11 @@ getdata(struct tbl_node *tbl, struct tbl */ sv = *pos; - while (p[*pos] != '\0' && p[*pos] != tbl->opts.tab) - (*pos)++; + ccp = p + sv; + while (*ccp != '\0' && *ccp != tbl->opts.tab) + if (*ccp++ == '\\') + mandoc_escape(&ccp, NULL, NULL); + *pos = ccp - p; /* Advance to the next layout cell, skipping spanners. */ -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv