Fix run_command. Fix crash on 64 bit archs.

This commit is contained in:
Kris Maglione 2007-06-27 12:57:55 -04:00
parent 511731482b
commit 8f766a75af
3 changed files with 17 additions and 9 deletions

View File

@ -347,13 +347,18 @@ message_root(void *p, Message *m) {
char *
read_root_ctl(void) {
uint i = 0;
i += snprintf(&buffer[i], (sizeof(buffer) - i), "view %s\n", screen->sel->name);
i += snprintf(&buffer[i], (sizeof(buffer) - i), "focuscolors %s\n", def.focuscolor.colstr);
i += snprintf(&buffer[i], (sizeof(buffer) - i), "normcolors %s\n", def.normcolor.colstr);
i += snprintf(&buffer[i], (sizeof(buffer) - i), "font %s\n", def.font->name);
i += snprintf(&buffer[i], (sizeof(buffer) - i), "grabmod %s\n", def.grabmod);
i += snprintf(&buffer[i], (sizeof(buffer) - i), "border %d\n", def.border);
char *b, *e;
b = buffer;
e = b + sizeof(buffer);
#define print(...) if(b < e) snprintf(b, e-b, __VA_ARGS__)
print("view %s\n", screen->sel->name);
print("focuscolors %s\n", def.focuscolor.colstr);
print("normcolors %s\n", def.normcolor.colstr);
print("font %s\n", def.font->name);
print("grabmod %s\n", def.grabmod);
print("border %d\n", def.border);
#undef print
return buffer;
}

View File

@ -324,7 +324,7 @@ char*
toutf8n(char *str, int nstr) {
static iconv_t cd;
char *buf, *pos;
int nbuf, bsize;
size_t nbuf, bsize;
if(cd == nil)
cd = iconv_open("UTF-8", "");

View File

@ -100,8 +100,11 @@ fn read_tags {
}
fn run_command {
@{
rfork ns
path=$oldpath { eval exec $* }
path=$oldpath
eval exec $* &
}
}
fn Event-CreateTag { echo $WMII_NORMCOLORS `{viewtitle $*} | wmiir create /lbar/$"* }