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 4711 invoked from network); 10 Sep 2021 13:25:10 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 10 Sep 2021 13:25:10 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 1312d637 for ; Fri, 10 Sep 2021 08:25:08 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id 398ff7c8 for ; Fri, 10 Sep 2021 08:25:08 -0500 (EST) Date: Fri, 10 Sep 2021 08:25:08 -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: Quirk-compatibility with GNU tbl(1): With the "nospaces" option, X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- Quirk-compatibility with GNU tbl(1): With the "nospaces" option, skip space characters before and after "T{", in addition to skipping those at the beginning and end of data cells. Minor issue reported by . 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.58 retrieving revision 1.59 diff -Ltbl_data.c -Ltbl_data.c -u -p -r1.58 -r1.59 --- tbl_data.c +++ tbl_data.c @@ -147,25 +147,28 @@ getdata(struct tbl_node *tbl, struct tbl dp->last->next = dat; dp->last = dat; + /* Strip leading and trailing spaces, if requested. */ + + endpos = *pos; + if (dp->opts->opts & TBL_OPT_NOSPACE) { + while (p[startpos] == ' ') + startpos++; + while (endpos > startpos && p[endpos - 1] == ' ') + endpos--; + } + /* * Check for a continued-data scope opening. This consists of a * trailing `T{' at the end of the line. Subsequent lines, * until a standalone `T}', are included in our cell. */ - if (*pos - startpos == 2 && + if (endpos - startpos == 2 && p[startpos] == 'T' && p[startpos + 1] == '{') { tbl->part = TBL_PART_CDATA; return; } - endpos = *pos; - if (dp->opts->opts & TBL_OPT_NOSPACE) { - while (p[startpos] == ' ') - startpos++; - while (endpos > startpos && p[endpos - 1] == ' ') - endpos--; - } dat->string = mandoc_strndup(p + startpos, endpos - startpos); if (p[*pos] != '\0') -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv