--- gforth/history.fs 1997/03/04 22:09:53 1.14 +++ gforth/history.fs 1997/09/01 23:07:07 1.15 @@ -71,17 +71,32 @@ interpret/compile: ctrl ( "" -- c history file-size throw 2dup forward^ 2! 2dup backward^ 2! end^ 2! ; -s" GFORTHHIST" getenv dup 0= [IF] - 2drop s" ~/.gforth-history" -[THEN] get-history - +s" os-class" environment? [IF] s" unix" compare 0= [ELSE] true [THEN] +[IF] : history-cold - Defers 'cold s" GFORTHHIST" getenv dup 0= IF 2drop s" ~/.gforth-history" THEN get-history ; +[ELSE] + +: history-dir + s" TMP" getenv ?dup ?EXIT drop + s" TEMP" getenv ?dup ?EXIT drop + s" c:/" ; + +: history-file + s" GFORTHHIST" getenv ?dup ?EXIT + drop + history-dir pad place + s" /ghist.txt" pad +place pad count ; + +: history-cold + history-file + get-history ; +[THEN] -' history-cold IS 'cold +' history-cold INIT8 chained +history-cold \ moving in history file 16oct94py