From 9a0c7cea4782b035b3f5c32767853b69b7886e37 Mon Sep 17 00:00:00 2001 From: Chris Webb Date: Fri, 22 Sep 2023 13:40:58 +0100 Subject: [PATCH] Fix quoting of arguments to kak -c SESSION Filename arguments to kak -c SESSION are passed to the remote sessions as commands like edit 'FILENAME'; but single-quotes in FILENAME are incorrectly escaped as \' instead of being doubled-up. Fix this so kak -c SESSION "foo'bar" becomes edit 'foo''bar'; instead of edit 'foo\'bar'; Reported by @FlyingWombat in https://github.com/mawww/kakoune/issues/4980 --- src/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index 7752bc66..411e7dfe 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1229,7 +1229,7 @@ int main(int argc, char* argv[]) } String new_files; for (auto name : files) { - new_files += format("edit '{}'", escape(real_path(name), "'", '\\')); + new_files += format("edit '{}'", escape(real_path(name), "'", '\'')); if (init_coord) { new_files += format(" {} {}", init_coord->line + 1, init_coord->column + 1); init_coord.reset();