diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2016-11-08 15:57:28 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2016-11-08 15:57:28 +0000 |
commit | 18bdca744233b5cb506a1d21e73f06e6b887cf66 (patch) | |
tree | 85874dba1f4a05726f8fb867e352508e921f9a24 | |
parent | 166e26365dfab6e9a571a95fad6bd1753eef4a78 (diff) | |
download | mandoc-18bdca744233b5cb506a1d21e73f06e6b887cf66.tar.gz |
skip leading \& and \e in tags
-rw-r--r-- | tag.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -130,7 +130,13 @@ tag_put(const char *s, int prio, size_t line) 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); |