wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit c14944c2b466ba0e5146863002f1af8b6d031209
parent 9f87cf8cc5bfb5a13363f36d255c255121c0fc15
Author: Kris Maglione <jg@suckless.org>
Date:   Mon,  4 Feb 2008 18:33:57 -0500

Fix some bugs.

Diffstat:
cmd/wmiistartrc.sh | 2+-
libwmii_hack/hack.c | 4++--
libwmii_hack/x11.c | 11+++++------
rc/rc.wmii.rc | 6+++---
4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/cmd/wmiistartrc.sh b/cmd/wmiistartrc.sh @@ -6,7 +6,7 @@ lconf="$home/.wmii-CONFVERSION" gconf="CONFPREFIX/wmii-CONFVERSION" export WMII_CONFPATH="$lconf:$gconf" -export POSIXLY_CORRECT=gnu_hippies +#export POSIXLY_CORRECT=gnu_hippies which="$(which which)" if wmii9rc; then diff --git a/libwmii_hack/hack.c b/libwmii_hack/hack.c @@ -7,6 +7,7 @@ #include <stdio.h> #include <sys/time.h> #include <sys/types.h> +#include <time.h> #include <unistd.h> #include "util.c" @@ -79,8 +80,7 @@ init(Display *d) { /* Hrm... assumes one display... */ unsetenv("WMII_HACK_TAGS"); n = tokenize(toks, nelem(toks)-1, s, '+'); - toks[n] = 0; - tags = strlistdup(toks); + tags = strlistdup(toks, n); free(s); } if((s = getenv("WMII_HACK_TIME"))) { diff --git a/libwmii_hack/x11.c b/libwmii_hack/x11.c @@ -151,14 +151,13 @@ strlistdup(char *list[], int n) { #endif static char** -strlistdup(char *list[]) { +strlistdup(char *list[], int n) { char **p, *q; - int i, m, n; + int i, m; - n = 0; m = 0; - for(p=list; *p; p++, n++) - m += strlen(*p) + 1; + for(i=0; i < n; i++) + m += strlen(list[i]) + 1; p = malloc((n+1) * sizeof(*p) + m); q = (char*)&p[n+1]; @@ -184,7 +183,7 @@ getprop_textlist(Display *display, Window w, char *name, char **ret[]) { XGetTextProperty(display, w, &prop, xatom(display, name)); if(prop.nitems > 0) { if(Xutf8TextPropertyToTextList(display, &prop, &list, &n) == Success) { - *ret = strlistdup(list); + *ret = strlistdup(list, n); XFreeStringList(list); } XFree(prop.value); diff --git a/rc/rc.wmii.rc b/rc/rc.wmii.rc @@ -123,10 +123,10 @@ fn Event-LeftBarMouseDown { # Actions fn Action-rehash { - comm -23 <{ls `{namespace}/proglist.* >[2]/dev/null | awk -F'\.' '{print $NF}'} \ + comm -23 <{ls `{namespace}^/proglist.* >[2]/dev/null | awk -F'.' '{print $NF}'} \ <{ps | awk '{print $2}'} | while(id=`{read}) - rm `{namespace}/proglist.$id + rm `{namespace}^/proglist.$id wi_proglist $PATH >$progs_file} fn Action-quit { wmiir xwrite /ctl quit} @@ -233,7 +233,7 @@ xsetroot -solid $wmiibackground Action overridekeys # Misc Setup -progs_file=`{namespace}/proglist.$pid +progs_file=`{namespace}^/proglist.$pid Action status Action rehash