From 22c65d7d609a441efb5e303a922890ae4b5a5813 Mon Sep 17 00:00:00 2001 From: arades79 Date: Sun, 8 Oct 2023 00:38:40 -0400 Subject: [PATCH] clarify unescaped chars Signed-off-by: arades79 --- src/calc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calc.c b/src/calc.c index ca4d74f..dba9302 100644 --- a/src/calc.c +++ b/src/calc.c @@ -407,7 +407,9 @@ static void execsh(char* cmd, char* entry) NULL); g_free(parts); - gchar *escaped_cmd = g_strescape(user_cmd, "·−×√²³⊻↊↋¬°"); + // don't escape these utf-8 runes which appear in qalc output, the escape sequences are not recognized by shell (#108) + static const char *unescaped_chars = "·−×√²³⊻↊↋¬°"; + gchar *escaped_cmd = g_strescape(user_cmd, unescaped_chars); gchar *complete_cmd = g_strdup_printf("/bin/sh -c \"%s\"", escaped_cmd); g_free(user_cmd); g_free(escaped_cmd);