[Gretl-users] problems with windows snapshot

Allin Cottrell cottrell at wfu.edu
Sun Jun 21 09:49:20 EDT 2009


On Sun, 21 Jun 2009, Sven Schreiber wrote:

> Am 19.06.2009 16:24, Allin Cottrell schrieb:
> > On Fri, 19 Jun 2009, Klein, Christoph wrote:
> >
> >> I've downloaded the windows snapshot (1.8.1cvs 2009-06-18) this
> >> morning. It seems to have problems when decrementing scalars.
> >> The following programm fails
> >>
> >> nulldata 10
> >> scalar d=1
> >> d-=1
> >>
> >> in the last line, saying "command d unknown"...
> >
> > Hmm, I can reproduce this using gretlcli.exe under wine on Linux.
> > But I note that substituting "d -=1" works OK.  I'll investigate;
> > strange that this sort of thing should differ by OS.
>
> Indeed! So I'm curious, what's the explanation that you seem to have
> found, given that it's fixed now?

It was actually a gretl bug: the code just "happened to work" on
Linux but not win32.  In parsing the sort of line in question we
need to extract the leading characters that are _not_ in the set
"[ +*/%^~|=-" to get a command word or variable name:

sscanf(s, "%15[^[ +*/%^~|=-]", word);

However, I had forgotten to put '-' at the end of this set, right
before the closing ']'.  If '-' appears somewhere in the middle
(as it did until this fix) it has a special meaning, namely
designating a range of characters, as in "a-z".

Allin.


More information about the Gretl-users mailing list