[PATCH] KStandardDirs::findExe()
David Faure
faure at kde.org
Tue Nov 6 23:34:39 GMT 2007
On Wednesday 07 November 2007, Dirk Mueller wrote:
>
> Hi,
>
> KStandardDirs::findExe() has currently the (IMHO undesired, but undocumented)
> behaviour of handling
>
>
> findExe("sh")
>
> different from
>
> cd /bin
> findExe("./sh")
>
> the problem is that the cod ein the latter case looks for "./sh" in each
> component of the $PATH. This is however not the behaviour the shell exposes:
> if it contains a path, then its relative to $PWD.
Looks ok, because bin never has subdirs (right?).
Otherwise one might expect that findExe("foo/bar") finds /usr/local/bin/foo/bar,
like KStandardDirs::locate() works in general (i.e. relative paths are relative to
the directories known by KStandardDirs, not relative to $PWD).
But for findExe I agree, being closer to the shell's behavior seems to make more sense
than being closer to usual KStandardDirs behavior.
--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel
mailing list