On Thursday 24 February 2011 19:11:02, Michael Snyder wrote:
+ if (isdigit (h[1]) || h[1] == '\0' || h[1] == ' ' || h[1] == '\t')
+ /* single-dollar history value */
+ index = strtol (&h[1], endp, 10);
Is this correct for the ' ' and '\t' cases? It looks
like it will accept "$ 3" as history value 3, but
it should parsed as "$" -- the last history value.
You're also not checking if the string is all
digits, so $123asdf is being accepted as $123, while
the language parsers treat that as an internal
variable. Maybe you should take a look at write_dollar_variable,
and factor out or borrow code from there to avoid these
discrepancies?