version 1.104, 2018/07/28 18:34:15 |
version 1.106, 2018/08/16 13:54:06 |
|
|
mandoc_escape(const char **end, const char **start, int *sz) |
mandoc_escape(const char **end, const char **start, int *sz) |
{ |
{ |
const char *local_start; |
const char *local_start; |
int local_sz; |
int local_sz, c, i; |
char term; |
char term; |
enum mandoc_esc gly; |
enum mandoc_esc gly; |
|
|
Line 139 mandoc_escape(const char **end, const char **start, in |
|
Line 139 mandoc_escape(const char **end, const char **start, in |
|
break; |
break; |
} |
} |
break; |
break; |
|
case '*': |
|
if (strncmp(*start, "(.T", 3) != 0) |
|
abort(); |
|
gly = ESCAPE_DEVICE; |
|
*start = ++*end; |
|
*sz = 2; |
|
break; |
|
|
/* |
/* |
* These escapes are of the form \X'Y', where 'X' is the trigger |
* These escapes are of the form \X'Y', where 'X' is the trigger |
Line 330 mandoc_escape(const char **end, const char **start, in |
|
Line 337 mandoc_escape(const char **end, const char **start, in |
|
} |
} |
break; |
break; |
case ESCAPE_SPECIAL: |
case ESCAPE_SPECIAL: |
if (1 == *sz && 'c' == **start) |
if (**start == 'c') { |
gly = ESCAPE_NOSPACE; |
if (*sz == 1) { |
|
gly = ESCAPE_NOSPACE; |
|
break; |
|
} |
|
if (*sz < 6 || *sz > 7 || |
|
strncmp(*start, "char", 4) != 0 || |
|
(int)strspn(*start + 4, "0123456789") + 4 < *sz) |
|
break; |
|
c = 0; |
|
for (i = 4; i < *sz; i++) |
|
c = 10 * c + ((*start)[i] - '0'); |
|
if (c < 0x21 || (c > 0x7e && c < 0xa0) || c > 0xff) |
|
break; |
|
*start += 4; |
|
*sz -= 4; |
|
gly = ESCAPE_NUMBERED; |
|
break; |
|
} |
|
|
/* |
/* |
* Unicode escapes are defined in groff as \[u0000] |
* Unicode escapes are defined in groff as \[u0000] |
* to \[u10FFFF], where the contained value must be |
* to \[u10FFFF], where the contained value must be |