-/* $Id: mandoc.c,v 1.23 2010/07/18 17:00:26 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.27 2010/07/25 19:05:59 joerg Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
p++;
switch (*p++) {
+#if 0
+ case ('Z'):
+ /* FALLTHROUGH */
+ case ('X'):
+ /* FALLTHROUGH */
+ case ('x'):
+ /* FALLTHROUGH */
+ case ('w'):
+ /* FALLTHROUGH */
+ case ('v'):
+ /* FALLTHROUGH */
+ case ('S'):
+ /* FALLTHROUGH */
+ case ('R'):
+ /* FALLTHROUGH */
+ case ('o'):
+ /* FALLTHROUGH */
+ case ('N'):
+ /* FALLTHROUGH */
+ case ('l'):
+ /* FALLTHROUGH */
+ case ('L'):
+ /* FALLTHROUGH */
+ case ('H'):
+ /* FALLTHROUGH */
+ case ('h'):
+ /* FALLTHROUGH */
+ case ('D'):
+ /* FALLTHROUGH */
+ case ('C'):
+ /* FALLTHROUGH */
+ case ('b'):
+ /* FALLTHROUGH */
+ case ('B'):
+ /* FALLTHROUGH */
+ case ('a'):
+ /* FALLTHROUGH */
+ case ('A'):
+ if (*p++ != '\'')
+ return(0);
+ term = '\'';
+ break;
+#endif
case ('s'):
if (ASCII_HYPH == *p)
*p = '-';
case ('\''):
term = '\'';
break;
+ case ('0'):
+ i++;
+ /* FALLTHROUGH */
default:
len = 1;
p--;
if (0 == i)
return(0);
break;
+#if 0
+ case ('Y'):
+ /* FALLTHROUGH */
+ case ('V'):
+ /* FALLTHROUGH */
+ case ('$'):
+ /* FALLTHROUGH */
+ case ('n'):
+ /* FALLTHROUGH */
+ case ('k'):
+ /* FALLTHROUGH */
+#endif
+ case ('M'):
+ /* FALLTHROUGH */
+ case ('m'):
+ /* FALLTHROUGH */
case ('f'):
/* FALLTHROUGH */
case ('F'):
for ( ; *p && term != *p; p++)
if (ASCII_HYPH == *p)
*p = '-';
- return(*p ? p - sv : 0);
+ return(*p ? (int)(p - sv) : 0);
}
for (i = 0; *p && i < len; i++, p++)
if (ASCII_HYPH == *p)
*p = '-';
- return(i == len ? p - sv : 0);
+ return(i == len ? (int)(p - sv) : 0);
}
*/
found = 0;
- for (q = p + sz - 1; q >= p; q--) {
+ for (q = p + (int)sz - 1; q >= p; q--) {
switch (*q) {
case ('\"'):
/* FALLTHROUGH */
found = 1;
break;
default:
- return(found && (!enclosed || isalnum(*q)));
+ return(found && (!enclosed || isalnum((unsigned char)*q)));
}
}