From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id d250391d for ; Wed, 3 Apr 2019 06:24:18 -0500 (EST) Date: Wed, 3 Apr 2019 06:24:18 -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: docbook2mdoc: handle attributes in single quotes X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- handle attributes in single quotes Modified Files: -------------- docbook2mdoc: parse.c statistics.c Revision Data ------------- Index: parse.c =================================================================== RCS file: /home/cvs/mdocml/docbook2mdoc/parse.c,v retrieving revision 1.9 retrieving revision 1.10 diff -Lparse.c -Lparse.c -u -p -r1.9 -r1.10 --- parse.c +++ parse.c @@ -692,14 +692,16 @@ parse_file(struct parse *p, int fd, cons /* Parse an attribute value. */ if (in_arg) { - if (in_quotes == 0 && b[pend] == '"') { - in_quotes = 1; + if (in_quotes == 0 && + (b[pend] == '\'' || b[pend] == '"')) { + in_quotes = b[pend] == '"' ? 2 : 1; p->ncol++; pend++; continue; } if (advance(p, b, rlen, &pend, - in_quotes ? "\"" : " >") && rsz > 0) + in_quotes == 2 ? "\"" : + in_quotes == 1 ? "'" : " >") && rsz > 0) break; in_arg = in_quotes = elem_end = 0; if (b[pend] == '>') { Index: statistics.c =================================================================== RCS file: /home/cvs/mdocml/docbook2mdoc/statistics.c,v retrieving revision 1.4 retrieving revision 1.5 diff -Lstatistics.c -Lstatistics.c -u -p -r1.4 -r1.5 --- statistics.c +++ statistics.c @@ -225,13 +225,15 @@ parse_file(int fd, char *fname) continue; } if (in_arg) { - if (in_quotes == 0 && b[pend] == '"') { - in_quotes = 1; + if (in_quotes == 0 && + (b[pend] == '\'' || b[pend] == '"')) { + in_quotes = b[pend] == '"' ? 2 : 1; pend++; continue; } if (advance(b, rlen, &pend, - in_quotes ? "\"" : " >") && rsz > 0) + in_quotes == 2 ? "\"" : + in_quotes == 1 ? "'" : " >") && rsz > 0) break; in_arg = in_quotes = elem_end = 0; if (b[pend] == '>') { -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv