From: Michael Stapelberg Date: Wed, 3 Aug 2011 01:33:12 +0000 (+0200) Subject: also handle quoted workspace names, extend t/72 for that X-Git-Tag: 4.0.2~66^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dcba8024deed7169598e936f8e1204077e7512ec;p=i3%2Fi3 also handle quoted workspace names, extend t/72 for that --- diff --git a/src/randr.c b/src/randr.c index e9ba0f07..441a0b43 100644 --- a/src/randr.c +++ b/src/randr.c @@ -378,8 +378,13 @@ void init_ws_for_output(Output *output, Con *content) { strncasecmp(bind->command, "workspace", strlen("workspace")) != 0) continue; DLOG("relevant command = %s\n", bind->command); + char *target = bind->command + strlen("workspace "); + if (*target == '"') + target++; FREE(ws->name); - ws->name = strdup(bind->command + strlen("workspace ")); + ws->name = strdup(target); + if (ws->name[strlen(ws->name)-1] == '"') + ws->name[strlen(ws->name)-1] = '\0'; DLOG("trying name *%s*\n", ws->name); TAILQ_FOREACH(out, &(croot->nodes_head), nodes) diff --git a/testcases/t/72-start-on-named-ws.t b/testcases/t/72-start-on-named-ws.t index 3ba8bb68..12661867 100644 --- a/testcases/t/72-start-on-named-ws.t +++ b/testcases/t/72-start-on-named-ws.t @@ -30,15 +30,32 @@ exit_gracefully($process->pid); # 2: with named workspaces, i3 should start on the first named one ############################################################## - -my $config = <pid); + +############################################################## +# 3: the same test as 2, but with a quoted workspace name +############################################################## + +$config = <