From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Implement the \: (optional line break) escape sequence,
Date: Wed, 22 Jan 2014 16:02:54 -0500 (EST) [thread overview]
Message-ID: <201401222102.s0ML2se1008337@krisdoz.my.domain> (raw)
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 <sdaoden at gmail dot com>.
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 <kristaps@bsd.lv>
- * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011, 2014 Ingo Schwarze <schwarze@openbsd.org>
*
* 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
next reply other threads:[~2014-01-22 21:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-22 21:02 schwarze [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-01-22 20:58 schwarze
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201401222102.s0ML2se1008337@krisdoz.my.domain \
--to=schwarze@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).