Handle file names with quotes.

Let's repurpose escape_string and make it more flexible by letting us
choose the characters to escape.
This commit is contained in:
LemonBoy 2017-02-21 15:54:31 +01:00
commit 027acffb42
4 changed files with 20 additions and 14 deletions

View file

@ -1113,7 +1113,7 @@ static void event_text(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
/* the nick is quoted in case it contains '-' character. also
spaces should work too now :) The nick is also escaped in case
it contains '\' characters */
target = escape_string(window_item_get_target(item));
target = escape_string(window_item_get_target(item), "\"'\\");
str = g_strdup_printf(IS_CHANNEL(item) ? "-channel \"%s\" %s" :
IS_QUERY(item) ? "-nick \"%s\" %s" : "%s %s",
target, line);