From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s0ML2s7d026436 for ; Wed, 22 Jan 2014 16:02:54 -0500 (EST) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id s0ML2se1008337; Wed, 22 Jan 2014 16:02:54 -0500 (EST) Date: Wed, 22 Jan 2014 16:02:54 -0500 (EST) Message-Id: <201401222102.s0ML2se1008337@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Implement the \: (optional line break) escape sequence, X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Implement the \: (optional line break) escape sequence, documented in the Ossanna-Kernighan-Ritter troff manual and also supported by groff. Missing feature reported by Steffen Nurpmeso . Tags: ---- VERSION_1_12 Modified Files: -------------- mdocml: apropos_db.c Revision Data ------------- Index: apropos_db.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/Attic/apropos_db.c,v retrieving revision 1.32.2.3 retrieving revision 1.32.2.4 diff -Lapropos_db.c -Lapropos_db.c -u -p -r1.32.2.3 -r1.32.2.4 --- apropos_db.c +++ apropos_db.c @@ -1,7 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons - * Copyright (c) 2011 Ingo Schwarze + * Copyright (c) 2011, 2014 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 @@ -259,8 +259,8 @@ norm_string(const char *val, const struc const char *seq, *cpp; int len, u, pos; enum mandoc_esc esc; - static const char res[] = { '\\', '\t', - ASCII_NBRSP, ASCII_HYPH, '\0' }; + static const char res[] = { '\\', '\t', ASCII_NBRSP, + ASCII_HYPH, ASCII_BREAK, '\0' }; /* Pre-allocate by the length of the input */ @@ -280,15 +280,23 @@ norm_string(const char *val, const struc val += (int)sz; } - if (ASCII_HYPH == *val) { + switch (*val) { + case (ASCII_HYPH): (*buf)[pos++] = '-'; val++; continue; - } else if ('\t' == *val || ASCII_NBRSP == *val) { + case ('\t'): + /* FALLTHROUGH */ + case (ASCII_NBRSP): (*buf)[pos++] = ' '; val++; + /* FALLTHROUGH */ + case (ASCII_BREAK): continue; - } else if ('\\' != *val) + default: + break; + } + if ('\\' != *val) break; /* Read past the slash. */ -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv