toolcontext: nit_dir tries another heuristic on PATH if procfs is not available
authorJean Privat <jean@pryen.org>
Sun, 2 Nov 2014 16:02:56 +0000 (11:02 -0500)
committerJean Privat <jean@pryen.org>
Mon, 3 Nov 2014 15:02:10 +0000 (10:02 -0500)
commit222d38955ed7d24d388123d7b6e7ef4c21dd65b1
treedaac059ffbf9043f7f57af64da43e87665624340
parent186012368e1a385b790df332e04b8db9fb339aee
toolcontext: nit_dir tries another heuristic on PATH if procfs is not available

procfs (/proc/) does not exists on some system (macosx).
Therefore the heuristic used to find nit_dir will fail on those system
when the command is invoked from the PATH.

The solution is to add another heuristic, where the program_name is
manually searched inside the directories of PATH in order to find the
original directory.

Reported-by: Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>
src/toolcontext.nit