wmmenugen: Add executable detection, make Wmconfig use it

Add fileInPath, which determines whether or not a given file exists
in $PATH (some heuristics apply).

Make the Wconfig parser use it.

Signed-off-by: Tamas TEVESZ <ice@extreme.hu>
This commit is contained in:
Tamas TEVESZ authored and Carlos R. Mafra committed 2010-10-10 19:34:45 +02:00
1 parent 0451160f7d
commit 5377ec8fba
3 files changed
+50 -2

No files matched your search

+4 -2
View File
@@ -185,8 +185,10 @@ static Bool wmc_to_wm(WMConfigMenuEntry **wmc, WMMenuEntry **wm)
char *p;
size_t slen;
/* only Exec is mandatory */
if (!*wmc || !(*wmc)->Exec || !*(*wmc)->Exec)
/* only Exec is mandatory, and it's better exist in a known place */
if (!*wmc ||
!(*wmc)->Exec || !*(*wmc)->Exec ||
!fileInPath((*wmc)->Exec))
return False;
/* normalize Exec: wmconfig tends to stuck an ampersand