X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Factions%2Fexecute.c;h=bde7f5d25a24ff4dc66dbd154fa160580646597e;hb=965ed8907a5dd81d5ffbc93b67a672fa78833854;hp=05ab2ef3c6fda7085c8fbf0aea0cd59f078d9567;hpb=7fb107cd37a09787c5cfa590688944b3bcb2bab8;p=chaz%2Fopenbox diff --git a/openbox/actions/execute.c b/openbox/actions/execute.c index 05ab2ef3..bde7f5d2 100644 --- a/openbox/actions/execute.c +++ b/openbox/actions/execute.c @@ -33,7 +33,7 @@ static void i_cancel_func(gpointer options); void action_execute_startup(void) { - actions_register("Execute", setup_func, free_func, run_func, NULL, NULL); + actions_register("Execute", setup_func, free_func, run_func); } static gpointer setup_func(xmlNodePtr node) @@ -144,7 +144,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) if (data->client) { gchar *c, *before, *expand; - /* replace occurances of $pid and $window */ + /* replace occurrences of $pid and $wid */ expand = NULL; before = cmd; @@ -168,13 +168,12 @@ static gboolean run_func(ObActionsData *data, gpointer options) before = c + 4; /* 4 = strlen("$pid") */ } - - if ((c[1] == 'w' || c[1] == 'W') && - (c[2] == 'i' || c[2] == 'I') && - (c[3] == 'd' || c[3] == 'D') && - !g_ascii_isalnum(c[7])) + else if ((c[1] == 'w' || c[1] == 'W') && + (c[2] == 'i' || c[2] == 'I') && + (c[3] == 'd' || c[3] == 'D') && + !g_ascii_isalnum(c[4])) { - /* found $window */ + /* found $wid */ gchar *tmp; *c = '\0'; @@ -185,8 +184,10 @@ static gboolean run_func(ObActionsData *data, gpointer options) data->client->window); g_free(tmp); - before = c + 7; /* 4 = strlen("$window") */ + before = c + 4; /* 4 = strlen("$wid") */ } + else + before = c + 1; /* no infinite loops plz */ } if (expand) {