aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/strings.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-02-24 13:46:54 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-02-24 13:46:54 +0000
commit89fbd7032339cc31f5c189d02050375f532bf281 (patch)
treea35fe7a2a24198f6d55f9f47e12c34ca3b5f2761 /strings.c
parentccc5179dd8a95f3867173f5e2265d6153b9d2635 (diff)
downloadmandoc-89fbd7032339cc31f5c189d02050375f532bf281.tar.gz
mandoc-89fbd7032339cc31f5c189d02050375f532bf281.tar.zst
mandoc-89fbd7032339cc31f5c189d02050375f532bf281.zip
Character-encoding checked for all text (arguments/values).
Diffstat (limited to 'strings.c')
-rw-r--r--strings.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/strings.c b/strings.c
index c3b0403d..fe400b37 100644
--- a/strings.c
+++ b/strings.c
@@ -1,4 +1,4 @@
-/* $Id: strings.c,v 1.16 2009/02/24 11:43:13 kristaps Exp $ */
+/* $Id: strings.c,v 1.17 2009/02/24 13:46:54 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -55,14 +55,16 @@ mdoc_isescape(const char *p)
/* FALLTHROUGH */
case (' '):
/* FALLTHROUGH */
+ case ('&'):
+ /* FALLTHROUGH */
case ('.'):
/* FALLTHROUGH */
case ('e'):
return(2);
case ('('):
- if (0 == *++p)
+ if (0 == *++p || ! isgraph(*p))
return(0);
- if (0 == *++p)
+ if (0 == *++p || ! isgraph(*p))
return(0);
return(4);
case ('['):
@@ -72,7 +74,7 @@ mdoc_isescape(const char *p)
}
for (c = 3, p++; *p && ']' != *p; p++, c++)
- if (isspace(*p))
+ if ( ! isgraph(*p))
break;
return(*p == ']' ? c : 0);