Skip to contentSkip to conversation

client: avoid segfault in iwctl quit

PATCH Applied Ronan Pigott 2 participants 2 messages May 2, 2023 – May 7, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 client: avoid segfault in iwctl quit

iwctl quit (running quit non-interactively) isn't a useful command, but it shouldn't segfault. Let's avoid calling readline functions if we haven't initialized readline in this run.

---
 client/display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
client/display.c +2 -1
index 59086642c273..8b06ff58384b 100644
@@ -890,7 +890,8 @@ void display_agent_prompt_release(const char *label)
 
 void display_quit(void)
 {
-	rl_crlf();
+	if (command_is_interactive_mode())
+		rl_crlf();
 }
 
 static void window_change_signal_handler(void *user_data)
Signature · 1 line
2.40.1
#1 lore raw

Hi Ronan,

Quoted 6 lines · Ronan Pigott

iwctl quit (running quit non-interactively) isn't a useful command, but it shouldn't segfault. Let's avoid calling readline functions if we haven't initialized readline in this run.

---
  client/display.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks.

Regards,
-Denis