From 66c4be596e3c1c3537969fcd9235b68a1d6401c3 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 13 Mar 2024 14:46:49 +0900 Subject: [PATCH] ptyfwd: drop redundant brackets --- src/shared/ptyfwd.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c index 38b89418cde..bdbd79087ca 100644 --- a/src/shared/ptyfwd.c +++ b/src/shared/ptyfwd.c @@ -419,7 +419,7 @@ static int pty_forward_ansi_process(PTYForward *f, size_t offset) { i += r; break; - case ANSI_COLOR_STATE_ESC: { + case ANSI_COLOR_STATE_ESC: if (c == '[') { f->ansi_color_state = ANSI_COLOR_STATE_CSI_SEQUENCE; @@ -428,11 +428,9 @@ static int pty_forward_ansi_process(PTYForward *f, size_t offset) { f->ansi_color_state = ANSI_COLOR_STATE_OSC_SEQUENCE; continue; } - break; - } - case ANSI_COLOR_STATE_CSI_SEQUENCE: { + case ANSI_COLOR_STATE_CSI_SEQUENCE: if (c >= 0x20 && c <= 0x3F) { /* If this is a "parameter" or "intermediary" byte (i.e. ranges 0x20…0x2F and @@ -460,11 +458,9 @@ static int pty_forward_ansi_process(PTYForward *f, size_t offset) { f->csi_sequence = mfree(f->csi_sequence); f->ansi_color_state = ANSI_COLOR_STATE_TEXT; } - continue; - } - case ANSI_COLOR_STATE_OSC_SEQUENCE: { + case ANSI_COLOR_STATE_OSC_SEQUENCE: if ((uint8_t) c >= ' ') { if (strlen_ptr(f->osc_sequence) >= 64) { @@ -493,9 +489,7 @@ static int pty_forward_ansi_process(PTYForward *f, size_t offset) { f->osc_sequence = mfree(f->osc_sequence); f->ansi_color_state = ANSI_COLOR_STATE_TEXT; } - continue; - } default: assert_not_reached(); -- 2.47.3