source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: skip leading \& and \e in tags
@ 2016-11-08 15:57 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2016-11-08 15:57 UTC (permalink / raw)
  To: source

Log Message:
-----------
skip leading \& and \e in tags

Modified Files:
--------------
    mdocml:
        tag.c

Revision Data
-------------
Index: tag.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/tag.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -Ltag.c -Ltag.c -u -p -r1.14 -r1.15
--- tag.c
+++ tag.c
@@ -130,7 +130,13 @@ tag_put(const char *s, int prio, size_t 
 	size_t			 len;
 	unsigned int		 slot;
 
-	if (tag_files.tfd <= 0 || strchr(s, ' ') != NULL)
+	/* Sanity checks. */
+
+	if (tag_files.tfd <= 0)
+		return;
+	if (s[0] == '\\' && (s[1] == '&' || s[1] == 'e'))
+		s += 2;
+	if (*s == '\0' || strchr(s, ' ') != NULL)
 		return;
 
 	slot = ohash_qlookup(&tag_data, s);
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-08 15:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-08 15:57 mdocml: skip leading \& and \e in tags schwarze

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).