ttcdt / mp-5.x

The Minimum Profit Text Editor
The Unlicense
23 stars 4 forks source link

inconsistent behaviour between mp-5-ncurses and mp-5-gtk #10

Open rofl0r opened 3 years ago

rofl0r commented 3 years ago

when running ./mp-5 (built with ncurses) from the builddir :

$ ./mp-5
mp_core.mpsl: file not found

./mp-5-gtk works without issues. examining strace output reveals that ncurses build tries to open the following paths:

$ strace ./mp-5 2>&1 | grep open | grep mp
open("/lib/libXcomposite.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/usr/local/share/mp-5/mp.zip/mp_core.mpsl", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/mp-5/mp.tar", O_RDONLY) = -1 ENOENT (No such file or directory)

and mp-5-gtk:

$ strace -f ./mp-5-gtk 2>&1 | grep open | grep mp
... on load nothing happens, except...
stat("/etc/mp.mpsl", 0x7fffa36cefa0)    = -1 ENOENT (No such file or directory)
stat("/home/usert/.mp.mpsl", 0x7fffa36cef20) = -1 ENOENT (No such file or directory)
... however after clicking on "open" which shows the open dialogue, mp-5-gtk opens every single file in the current directory, which is rather inefficient...
[pid 19380] open("/home/user/tmp/mp-5.x-neo/README", O_RDONLY|O_NOATIME <unfinished ...>
[pid 19382] open("/home/user/tmp/mp-5.x-neo/RELEASE_NOTES", O_RDONLY|O_NOATIME <unfinished ...>
[pid 19387] open("/home/user/tmp/mp-5.x-neo/VERSION", O_RDONLY|O_NOATIME <unfinished ...>
... etc ...
rofl0r commented 3 years ago

it gets even weirder, after studying mp_core.c and running

~/tmp/mp-5.x-neo[config_2]$ MP_LIBRARY_PATH=. ./mp-5

the gtk version of mp-5 opens...

rofl0r commented 3 years ago

so, it seems at least the mp_core.mpsl: file not found was caused by my own patch (reverted here: d6539c53953665960ba45f3c50c2f1dba68e12f6)