From 6f28a38d4d9d68e43313ddc45f1e46836216cd71 Mon Sep 17 00:00:00 2001 From: id Date: Fri, 24 Sep 1999 08:12:18 +0000 Subject: [PATCH] try to fix open menus, hope it worx. --- src/misc.c | 10 ++++++++-- src/rootmenu.c | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/misc.c b/src/misc.c index e4b2612a..0ee3fc39 100644 --- a/src/misc.c +++ b/src/misc.c @@ -155,9 +155,15 @@ MakeCPPArgs(char *path) * search path */ if (path) { tmp = wstrdup(path); + buf = strchr(tmp+1, ' '); + if (buf) { + *buf = 0; + } buf = strrchr(tmp, '/'); - if (buf) *buf = 0; /* trunc filename */ - putdef(line, " -I", tmp); + if (buf) { + *buf = 0; /* trunc filename */ + putdef(line, " -I", tmp); + } free(tmp); } diff --git a/src/rootmenu.c b/src/rootmenu.c index 68963402..1bee7bf0 100644 --- a/src/rootmenu.c +++ b/src/rootmenu.c @@ -623,12 +623,12 @@ separateCommand(char *line, char ***file, char **command) count = WMGetBagItemCount(bag); if (count>0) { - int j; + int j; *file = wmalloc(sizeof(char*)*(count+1)); i = count; (*file)[count] = NULL; - for (j = 0; j < count; j++) { - (*file)[--i] = WMGetFromBag(bag, j); + for (j = 0; j < count; j++) { + (*file)[j] = WMGetFromBag(bag, j); } } WMFreeBag(bag);