-/* $Id: mandoc.c,v 1.25 2010/07/21 20:35:03 kristaps Exp $ */
+/* $Id: mandoc.c,v 1.28 2010/08/16 09:37:58 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
/* FALLTHROUGH */
case ('w'):
/* FALLTHROUGH */
- case ('v'):
- /* FALLTHROUGH */
case ('S'):
/* FALLTHROUGH */
case ('R'):
term = '\'';
break;
#endif
+ case ('h'):
+ /* FALLTHROUGH */
+ case ('v'):
+ /* FALLTHROUGH */
case ('s'):
if (ASCII_HYPH == *p)
*p = '-';
- if ('+' == *p || '-' == *p)
- p++;
- i = ('s' != *(p - 1));
+ i = 0;
+ if ('+' == *p || '-' == *p) {
+ p++;
+ i = 1;
+ }
switch (*p++) {
case ('('):
case ('\''):
term = '\'';
break;
+ case ('0'):
+ i = 1;
+ /* FALLTHROUGH */
default:
len = 1;
p--;
if (ASCII_HYPH == *p)
*p = '-';
if ('+' == *p || '-' == *p) {
- if (i++)
+ if (i)
return(0);
p++;
}
- if (0 == i)
- return(0);
break;
#if 0
case ('Y'):
found = 1;
break;
default:
- return(found && (!enclosed || isalnum(*q)));
+ return(found && (!enclosed || isalnum((unsigned char)*q)));
}
}