mirror of https://github.com/0intro/wmii
Fix run_command. Fix crash on 64 bit archs.
This commit is contained in:
parent
511731482b
commit
8f766a75af
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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", "");
|
||||
|
|
|
@ -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/$"* }
|
||||
|
|
Loading…
Reference in New Issue