Allow escaping backslashes

Fixes #1577.
This commit is contained in:
shdown
2015-03-25 21:30:38 +03:00
parent e8704bb33b
commit 6d8891894e
2 changed files with 9 additions and 8 deletions

View File

@ -489,7 +489,7 @@ void handle_button(xcb_button_press_event_t *event) {
size_t namelen = 0;
const char *utf8_name = cur_ws->canonical_name;
for (const char *walk = utf8_name; *walk != '\0'; walk++) {
if (*walk == '"')
if (*walk == '"' || *walk == '\\')
num_quotes++;
/* While were looping through the name anyway, we can save one
* strlen(). */
@ -503,7 +503,7 @@ void handle_button(xcb_button_press_event_t *event) {
for (inpos = 0, outpos = strlen("workspace \"");
inpos < namelen;
inpos++, outpos++) {
if (utf8_name[inpos] == '"') {
if (utf8_name[inpos] == '"' || utf8_name[inpos] == '\\') {
buffer[outpos] = '\\';
outpos++;
}