On Thursday 19 May 2005 05:38, Robert Epprecht wrote:
> Bernd Paysan <[EMAIL PROTECTED]> writes:
> > Hm, strange. I can't reproduce it here. Maybe there's something in
> > your bigforth.cnf that produces the 0.
>
> I will investigate when I come back from work, but I did *not* change
> bigforth.cnf in any way after installation.

Ok, I found the bug. Go to fileint.fb, screen 42. There, ?path is the 
culprit. It assumes that env$ returns a single 0 for the empty 
environment variable. However, I changed that to return 0 0 for "not 
exist", and "addr 0" for "exists, but has length 0". So ?path should 
really be

| : ?path ( addr u -- )  over IF  setpath  ELSE  2drop  THEN ;

The reason I couldn't reproduce it is that BIGFORTH_PATH is set here.

The reason the stack is cleaned up again during boot is somewhere else. 
Look at forth.fb, screen 167. There, main: ends with RESTART. This 
finally calls ABORT, cleaning the stack. It's not necessary to do that, 
you could call QUIT instead. Note also that I'd rather put DO-COMMAND 
after the terminal initialization than before (as it is now). The new 
main: here will look like that on the next revision:

main: [IFDEF] :unix  !signals  [THEN]
      forth.fb standardi/o bot  do-command
      cr  FORTHstart 2+ count  cols over - 2/ spaces  type cr
      ( restart ) quit ;

May the Forth be with you.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/

Attachment: pgpSpq4Q0YXfQ.pgp
Description: PGP signature

Reply via email to