From d8a7b234bb4a718750f0649e07ce17101fb37c24 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 27 Feb 2026 19:33:28 +0100 Subject: [PATCH] fix: segfault when using /command help Usually we use `/help command`. Additionally there is a shortcut `/comamnd?`. 54fea4afcf38a28e074e12b4e092ec94b3251c11 tried to introduce to have `/command help`. Which doesn't really work since most commands get this as parameters. So it never worked. Additionally it introduced at segfault because it tried to set *question_mark to NULL even we can also get there without the `?` but by having the `help` as parameter. --- src/command/cmd_funcs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 9f74d72f..383cde81 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -154,10 +154,8 @@ cmd_process_input(ProfWin* window, char* inp) if (inp[0] == '/') { auto_char char* inp_cpy = strdup(inp); char* command = strtok(inp_cpy, " "); - char* second_word = strtok(NULL, " "); - gboolean wants_help = second_word ? strcmp(second_word, "help") == 0 : FALSE; char* question_mark = strchr(command, '?'); - if (wants_help || question_mark) { + if (question_mark) { *question_mark = '\0'; auto_gchar gchar* fakeinp = g_strdup_printf("/help %s", command + 1); if (fakeinp) {