mirror of
https://github.com/urlysses/1991.git
synced 2024-11-16 01:28:06 -05:00
Fix bug where repeat invocations of sourcedir returned different results (due to abuse of sourcefilename memore address)
This commit is contained in:
parent
6310938b54
commit
f0cac5c8f2
4
1991.fs
4
1991.fs
@ -19,9 +19,11 @@ include unix/socket.fs
|
|||||||
\ Useful for specifying in which dir to find
|
\ Useful for specifying in which dir to find
|
||||||
\ specific files (e.g., public/, views/).
|
\ specific files (e.g., public/, views/).
|
||||||
sourcefilename \ get the name of our file
|
sourcefilename \ get the name of our file
|
||||||
|
pad dup >r place \ copy the string so we don't
|
||||||
|
r> count \ modify sourcefilename.
|
||||||
2dup reverse \ reverse and search for first /
|
2dup reverse \ reverse and search for first /
|
||||||
s" /" search if \ if found, reverse string to
|
s" /" search if \ if found, reverse string to
|
||||||
2dup reverse \ to strip the filename but keep dir.
|
2dup reverse \ strip the filename but keep dir.
|
||||||
else
|
else
|
||||||
2drop \ no slash,
|
2drop \ no slash,
|
||||||
s" ./" \ same dir execution.
|
s" ./" \ same dir execution.
|
||||||
|
Loading…
Reference in New Issue
Block a user