Fixed bugs in .so build, wmiistartrc. Thanks to Alexis Hildebrandt.

This commit is contained in:
Kris Maglione 2008-01-26 10:03:06 -05:00
parent 0deae5eaff
commit 079473c859
6 changed files with 46 additions and 46 deletions

View File

@ -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*

View File

@ -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

View File

@ -219,7 +219,7 @@ Rectangle* view_rects(View*, uint *num, Frame *ignore);
/* 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*);

View File

@ -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;

View File

@ -8,13 +8,13 @@ gconf="CONFPREFIX/wmii-CONFVERSION"
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" "$@"

View File

@ -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 @@ clean:
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