version 1.103, 2017/07/03 13:40:19 |
version 1.105, 2018/08/10 22:12:44 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
|
|
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 330 mandoc_escape(const char **end, const char **start, in |
|
Line 330 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 |
Line 540 mandoc_normdate(struct roff_man *man, char *in, int ln |
|
Line 558 mandoc_normdate(struct roff_man *man, char *in, int ln |
|
cp = time2a(t); |
cp = time2a(t); |
if (t > time(NULL) + 86400) |
if (t > time(NULL) + 86400) |
mandoc_msg(MANDOCERR_DATE_FUTURE, man->parse, |
mandoc_msg(MANDOCERR_DATE_FUTURE, man->parse, |
|
ln, pos, cp); |
|
else if (*in != '$' && strcmp(in, cp) != 0) |
|
mandoc_msg(MANDOCERR_DATE_NORM, man->parse, |
ln, pos, cp); |
ln, pos, cp); |
return cp; |
return cp; |
} |
} |