1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

api: fix handle of invalid escape in function string_convert_escaped_chars()

And a new test is now checking that "\" returns "".
This commit is contained in:
Sébastien Helleu
2015-08-24 11:05:31 +02:00
parent c8ac75601f
commit 41cb1bf635
3 changed files with 8 additions and 3 deletions
+6 -3
View File
@@ -787,9 +787,12 @@ string_convert_escaped_chars (const char *string)
}
break;
default:
output[pos_output++] = '\\';
output[pos_output++] = ptr_string[0];
ptr_string++;
if (ptr_string[0])
{
output[pos_output++] = '\\';
output[pos_output++] = ptr_string[0];
ptr_string++;
}
break;
}
}