version 1.85, 2014/08/16 19:00:01 |
version 1.87, 2014/10/13 17:17:45 |
Line 79 mandoc_escape(const char **end, const char **start, in |
|
Line 79 mandoc_escape(const char **end, const char **start, in |
|
break; |
break; |
case '[': |
case '[': |
gly = ESCAPE_SPECIAL; |
gly = ESCAPE_SPECIAL; |
/* |
|
* Unicode escapes are defined in groff as \[uXXXX] to |
|
* \[u10FFFF], where the contained value must be a valid |
|
* Unicode codepoint. Here, however, only check whether |
|
* it's not a zero-width escape. |
|
*/ |
|
if ('u' == (*start)[0] && ']' != (*start)[1]) |
|
gly = ESCAPE_UNICODE; |
|
term = ']'; |
term = ']'; |
break; |
break; |
case 'C': |
case 'C': |
if ('\'' != **start) |
if ('\'' != **start) |
return(ESCAPE_ERROR); |
return(ESCAPE_ERROR); |
*start = ++*end; |
*start = ++*end; |
if ('u' == (*start)[0] && '\'' != (*start)[1]) |
gly = ESCAPE_SPECIAL; |
gly = ESCAPE_UNICODE; |
|
else |
|
gly = ESCAPE_SPECIAL; |
|
term = '\''; |
term = '\''; |
break; |
break; |
|
|
Line 199 mandoc_escape(const char **end, const char **start, in |
|
Line 188 mandoc_escape(const char **end, const char **start, in |
|
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case 'x': |
case 'x': |
if (strchr(" %&()*+-./0123456789:<=>", **start)) { |
if (strchr(" %&()*+-./0123456789:<=>", **start)) { |
++*end; |
if ('\0' != **start) |
|
++*end; |
return(ESCAPE_ERROR); |
return(ESCAPE_ERROR); |
} |
} |
gly = ESCAPE_IGNORE; |
gly = ESCAPE_IGNORE; |
Line 343 mandoc_escape(const char **end, const char **start, in |
|
Line 333 mandoc_escape(const char **end, const char **start, in |
|
case ESCAPE_SPECIAL: |
case ESCAPE_SPECIAL: |
if (1 == *sz && 'c' == **start) |
if (1 == *sz && 'c' == **start) |
gly = ESCAPE_NOSPACE; |
gly = ESCAPE_NOSPACE; |
|
/* |
|
* Unicode escapes are defined in groff as \[uXXXX] |
|
* to \[u10FFFF], where the contained value must be |
|
* a valid Unicode codepoint. Here, however, only |
|
* check the length and the validity of all digits. |
|
*/ |
|
else if (*sz > 4 && *sz < 8 && **start == 'u' && |
|
(int)strspn(*start + 1, "0123456789ABCDEFabcdef") |
|
+ 1 == *sz) |
|
gly = ESCAPE_UNICODE; |
break; |
break; |
default: |
default: |
break; |
break; |