summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-04-25 14:11:30 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-04-25 14:11:30 +0000
commit4141519fb7f60b45e5a438bff710b80820adfe4d (patch)
tree7aac88c26efebc2dd4c35a3160d62d0d416fa181 /mdoc.c
parent1d17ea6790b69372d535d740e9db5aa20a30ca98 (diff)
downloadmandoc-4141519fb7f60b45e5a438bff710b80820adfe4d.tar.gz
Fix a minor optimization i broke in rev. 1.163 on August 20, 2010:
Do not bother looking into the hash table when the length of the macro already tells us it's invalid. No functional change. Noticed by jsg@, thanks!
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mdoc.c b/mdoc.c
index 5a9271b0..69b74042 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -865,7 +865,7 @@ mdoc_pmacro(struct mdoc *mdoc, int ln, char *buf, int offs)
mac[i] = '\0';
- tok = (i > 1 || i < 4) ? mdoc_hash_find(mac) : MDOC_MAX;
+ tok = (i > 1 && i < 4) ? mdoc_hash_find(mac) : MDOC_MAX;
if (MDOC_MAX == tok) {
mandoc_vmsg(MANDOCERR_MACRO, mdoc->parse,