/* CCL print rpn tree - infix notation
* Europagate, 1995
*
- * $Id: cclptree.c,v 1.9 2007-04-25 20:50:56 adam Exp $
+ * $Id: cclptree.c,v 1.10 2007-05-01 12:12:34 adam Exp $
*
* Old Europagate Log:
*
static void ccl_prterm(WRBUF w, const char *term)
{
- const char *cp = term;
- for (; *cp; cp++)
+ if (!*term)
+ wrbuf_puts(w, "\"\"");
+ else
{
- if (*cp == ' ' || *cp == '\\')
- wrbuf_putc(w, '\\');
- wrbuf_putc(w, *cp);
+ const char *cp = term;
+ for (; *cp; cp++)
+ {
+ if (*cp == ' ' || *cp == '\\')
+ wrbuf_putc(w, '\\');
+ wrbuf_putc(w, *cp);
+ }
}
wrbuf_puts(w, " ");
}
{
struct ccl_rpn_attr *att;
+ if (!p)
+ return;
if (indent != -1)
{
int i;