Skip to content

Commit

Permalink
clarify unescaped chars
Browse files Browse the repository at this point in the history
Signed-off-by: arades79 <scravers@protonmail.com>
  • Loading branch information
arades79 committed Oct 8, 2023
1 parent 98e7eb0 commit 22c65d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/calc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 22c65d7

Please sign in to comment.