changeset: 2263:21841eb0db06
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Sat Jan 26 10:03:06 2008 -0500
summary: Fixed bugs in .so build, wmiistartrc. Thanks to Alexis Hildebrandt.
diff -r 19e255ab6518 -r 21841eb0db06 cmd/wmii/_util.c
--- a/cmd/wmii/_util.c Fri Jan 25 14:57:13 2008 -0500
+++ b/cmd/wmii/_util.c Sat Jan 26 10:03:06 2008 -0500
@@ -106,24 +106,21 @@ comm(int cols, char **toka, char **tokb)
return ret;
}
-char**
+void
grep(char **list, Reprog *re, int flags) {
- Vector_ptr vec;
- char **p;
+ char **p, **q;
int res;
- vector_pinit(&vec);
- for(p=list; *p; p++) {
+ q = list;
+ for(p=q; *p; p++) {
res = 0;
if(re)
res = regexec(re, *p, nil, 0);
if(res && !(flags & GInvert)
|| !res && (flags & GInvert))
- vector_ppush(&vec, *p);
+ *q++ = *p;
}
- p = strlistdup((char**)vec.ary, vec.n);
- free(vec.ary);
- return p;
+ *q = nil;
}
char*
diff -r 19e255ab6518 -r 21841eb0db06 cmd/wmii/client.c
--- a/cmd/wmii/client.c Fri Jan 25 14:57:13 2008 -0500
+++ b/cmd/wmii/client.c Sat Jan 26 10:03:06 2008 -0500
@@ -950,7 +950,7 @@ apply_tags(Client *c, const char *tags)
bool add;
char buf[512], last;
char *toks[32];
- char **p, **q;
+ char **p;
char *cur, *s;
buf[0] = 0;
@@ -1040,21 +1040,17 @@ apply_tags(Client *c, const char *tags)
qsort(toks, j, sizeof *toks, strpcmp);
uniq(toks);
- /* I'm setting a new convention here by putting free calls on
- * the same line as the list processing calls which obselete
- * their variables. It may be odd, but it makes the code
- * flow much clearer;
- */
-
s = join(toks, "+");
- utflcpy(c->tags, s, sizeof c->tags); free(s);
- changeprop_string(&c->w, "_WMII_TAGS", c->tags);
+ utflcpy(c->tags, s, sizeof c->tags);
+ changeprop_string(&c->w, "_WMII_TAGS", s);
+ free(s);
free(c->retags);
p = view_names();
- q = grep(p, c->tagre.regc, 0); free(p);
- p = grep(q, c->tagvre.regc, GInvert); free(q);
- c->retags = comm(CRight, toks, p); free(p);
+ grep(p, c->tagre.regc, 0);
+ grep(p, c->tagvre.regc, GInvert);
+ c->retags = comm(CRight, toks, p);
+ free(p);
if(c->retags[0] == nil && toks[0] == nil) {
if(c->tagre.regex)
@@ -1065,7 +1061,8 @@ apply_tags(Client *c, const char *tags)
}
p = comm(~0, c->retags, toks);
- client_setviews(c, p); free(p);
+ client_setviews(c, p);
+ free(p);
}
void
diff -r 19e255ab6518 -r 21841eb0db06 cmd/wmii/fns.h
--- a/cmd/wmii/fns.h Fri Jan 25 14:57:13 2008 -0500
+++ b/cmd/wmii/fns.h Sat Jan 26 10:03:06 2008 -0500
@@ -219,7 +219,7 @@ Rectangle* view_rects(View*, uint *num,
/* util.c */
char** comm(int, char**, char**);
-char** grep(char**, Reprog*, int);
+void grep(char**, Reprog*, int);
char* join(char**, char*);
void refree(Regex*);
void reinit(Regex*, char*);
diff -r 19e255ab6518 -r 21841eb0db06 cmd/wmii/x11.c
--- a/cmd/wmii/x11.c Fri Jan 25 14:57:13 2008 -0500
+++ b/cmd/wmii/x11.c Sat Jan 26 10:03:06 2008 -0500
@@ -889,6 +889,12 @@ sethints(Window *w) {
h->max.y = xs.max_height;
}
+ /* Goddamn buggy clients. */
+ if(h->max.x < h->min.x)
+ h->max.x = h->min.x;
+ if(h->max.y < h->min.y)
+ h->max.y = h->min.y;
+
h->base = h->min;
if(xs.flags & PBaseSize) {
p.x = xs.base_width;
diff -r 19e255ab6518 -r 21841eb0db06 cmd/wmiistartrc.sh
--- a/cmd/wmiistartrc.sh Fri Jan 25 14:57:13 2008 -0500
+++ b/cmd/wmiistartrc.sh Sat Jan 26 10:03:06 2008 -0500
@@ -8,13 +8,13 @@ export WMII_CONFPATH="$lconf:$gconf"
export WMII_CONFPATH="$lconf:$gconf"
export POSIXLY_CORRECT=gnu_hippies
-which="`which which`"
+which="$(which which)"
if wmii9rc; then
- WMIIRC=`PATH="$WMII_CONFPATH:$PATH" $which rc.wmii`
+ WMIIRC="$(PATH="$WMII_CONFPATH:$PATH" $which rc.wmii)"
else
- WMIIRC=`PATH="$WMII_CONFPATH:$PATH" $which wmiirc`
+ WMIIRC="$(PATH="$WMII_CONFPATH:$PATH" $which wmiirc)"
fi
-mkdir $conf 2>/dev/null && $gconf/welcome &
+mkdir $lconf 2>/dev/null && $gconf/welcome &
exec "$WMIIRC" "$@"
diff -r 19e255ab6518 -r 21841eb0db06 mk/hdr.mk
--- a/mk/hdr.mk Fri Jan 25 14:57:13 2008 -0500
+++ b/mk/hdr.mk Sat Jan 26 10:03:06 2008 -0500
@@ -1,5 +1,22 @@
+FILTER = cat
+EXCFLAGS = -I$$(echo $(INCPATH)|sed 's/:/ -I/g') -D_XOPEN_SOURCE=600
+COMPILE= CC="$(CC)" CFLAGS="$(EXCFLAGS) $(CFLAGS)" $(ROOT)/util/compile
+COMPILEPIC= CC="$(CC)" CFLAGS="$(EXCFLAGS) $(CFLAGS) $(SOCFLAGS)" $(ROOT)/util/compile
+LINK= LD="$(LD)" LDFLAGS="$(LDFLAGS)" $(ROOT)/util/link
+LINKSO= LD="$(LD)" LDFLAGS="$(SOLDFLAGS) $(SHARED)" $(ROOT)/util/link
+CLEANNAME=$(ROOT)/util/cleanname
+SOEXT=so
+
+include $(ROOT)/config.mk
+
+# I hate this.
+MKCFGSH=if test -f $(ROOT)/config.local.mk; then echo $(ROOT)/config.local.mk; else echo /dev/null; fi
+MKCFG:=${shell $(MKCFGSH)}
+MKCFG!=${MKCFGSH}
+include $(MKCFG)
+
.SILENT:
-.SUFFIXES: .O .o .o_pic .c .sh .rc .so .dylib .awk .1 .depend .install .uninstall .clean
+.SUFFIXES: .O .o .o_pic .c .sh .rc .$(SOEXT) .awk .1 .depend .install .uninstall .clean
all:
.c.depend:
@@ -40,7 +57,7 @@ all:
echo UNINSTALL $$($(CLEANNAME) $(BASE)$*)
rm -f $(BIN)/$*
-.a.install .so.install:
+.a.install .$(SOEXT).install:
echo INSTALL $$($(CLEANNAME) $(BASE)$<)
cp -f $< $(LIBDIR)/$<
chmod 0644 $(LIBDIR)/$<
@@ -76,22 +93,5 @@ install: printinstall mkdirs
install: printinstall mkdirs
depend: cleandep
-FILTER = cat
-EXCFLAGS = -I$$(echo $(INCPATH)|sed 's/:/ -I/g') -D_XOPEN_SOURCE=600
-COMPILE= CC="$(CC)" CFLAGS="$(EXCFLAGS) $(CFLAGS)" $(ROOT)/util/compile
-COMPILEPIC= CC="$(CC)" CFLAGS="$(EXCFLAGS) $(CFLAGS) $(SOCFLAGS)" $(ROOT)/util/compile
-LINK= LD="$(LD)" LDFLAGS="$(LDFLAGS)" $(ROOT)/util/link
-LINKSO= LD="$(LD)" LDFLAGS="$(SOLDFLAGS) $(SHARED)" $(ROOT)/util/link
-CLEANNAME=$(ROOT)/util/cleanname
-SOEXT=so
-
-include $(ROOT)/config.mk
-
-# I hate this.
-MKCFGSH=if test -f $(ROOT)/config.local.mk; then echo $(ROOT)/config.local.mk; else echo /dev/null; fi
-MKCFG:=${shell $(MKCFGSH)}
-MKCFG!=${MKCFGSH}
-include $(MKCFG)
-
include $(ROOT)/mk/common.mk
Received on Sat Jan 26 2008 - 16:07:23 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:59:11 UTC