Testing cfuncs:
moved libcfunc.so to /usr/local/bin
TRACE=-1 FPATH=/usr/local/bin ./cfuncs
: main()
cfuncs.icn : 10 | gen(procedure bitcount,500)
cfuncs.icn : 18 | | bitcount(list_1 = [500])
cfunc.icn : 40 | | | pathload("libcfunc.so","bitcount")
io.icn : 754 | | | | pathfind("libcfunc.so","/usr/local/bin /...",&null)
io.icn : 711 | | | | | isabspath("libcfunc.so")
io.icn : 696 | | | | | isabspath failed
io.icn : 735 | | | | pathfind failed
cannot find "libcfunc.so" on path ". /usr/local/bin /aufs/uni5197sim/bin:/aufs/uni5197sim/bin/"
# ^ note: spaces and colons mixed
# also, if iconx is not on path,
# its dir is not checked for the lib
workaround:
FPATH=/usr/local/bin/: ./cfuncs
# ^ works. note the ^ :
src/runtime/imain.r has
"FPATH=%s %s"
while pathfind looks for dir:dir
icont always adds " dir dir dir ..."
to $IPATH and $LPATH
see common/mlocal.c: libpath()
pathfind by default checks $DPATH, or else $PATH, and it must use for these
by default the system's separator, ok.
Is this documented anywhere?
pathload checks $FPATH, which ALWAYS has spaces, by calling pathfind(fname,path)
It is looking for ":" or ";" because psep is omitted.
should be called as
pathfind(fname,path," ")
on any UNIX:
pathload before [r2724]
added " dir" then called pathfind
which searched for dir:dir
currently pathload adds ":dir"
after iconx added " dir"
giving "dir dir:dir"
Related
Commit: [r2724]
If FPATH is like icon's IPATH,
not like system's PATH,
io.icn needs:
in procedure pathload:
- path ||:= psep || sfeat[13:0]
+ path ||:= " " || sfeat[13:0]
+# this can be changed by patchstr iconx newpath
- found := pathfind(fname, path)
+ found := pathfind(fname, path, " ") # pathfind prepends "."
I can take this if you like
Please do!
fixed in [r5610]
Related
Commit: [r5610]