Re: [PATCH] Fix 'Undefined command' error message

Eli Zaretskii
2005-11-15T19:06:37Z

> Date: Tue, 15 Nov 2005 14:09:14 +0000
> From: Andrew STUBBS <andrew.stubbs@st.com>
>
> - while (isalnum (*p) || *p == '-')
> + while (*p && (isalnum (*p) || *p == '-' || *p == '_' ||

Why is there a need for testing *p to be non-zero? AFAIK, isalnum is
well defined for a zero argument.

> +#if defined(TUI)
> + (tui_active &&
> + (*p == '+' || *p == '<' || *p == '>' || *p == '$')) ||
> +#endif

What is the reason for additional tests under TUI?

> + (xdb_commands && (*p == '!' || *p == '/' || *p == '?'))))

Is this for some kind of compatibility with XDB?

(Yes, I know that you simply lifted code from elsewhere in
cli-decode.c, but still... At the very least, the non-trivial
characters warrant a comment that explains why they are there.)