-/* $Id: mdoc_strings.c,v 1.15 2010/03/29 19:28:04 kristaps Exp $ */
+/* $Id: mdoc_strings.c,v 1.18 2010/05/09 21:06:50 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
};
+/*
+ * FIXME: this is repeated in print_text() (html.c) and term_word()
+ * (term.c).
+ */
int
mdoc_iscdelim(char p)
{
case('('):
/* FALLTHROUGH */
case('['):
- /* FALLTHROUGH */
- case('{'):
return(1);
case('.'):
/* FALLTHROUGH */
case(')'):
/* FALLTHROUGH */
case(']'):
- /* FALLTHROUGH */
- case('}'):
return(2);
default:
break;
mdoc_isdelim(const char *p)
{
- if (0 == *p)
- return(0);
- if (0 != *(p + 1))
+ if ('\0' == p[0])
return(0);
- return(mdoc_iscdelim(*p));
+ if ('\0' == p[1])
+ return(mdoc_iscdelim(p[0]));
+
+ /*
+ * XXX; account for groff bubu where the \*(Ba reserved string
+ * is treated in exactly the same way as the vertical bar. This
+ * is the only function that checks for this.
+ */
+ return(0 == strcmp(p, "\\*(Ba"));
}
/* FIXME: move this into an editable .in file. */
size_t
-mdoc_macro2len(int macro)
+mdoc_macro2len(enum mdoct macro)
{
switch (macro) {