]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ptyfwd: drop redundant brackets 31747/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 13 Mar 2024 05:46:49 +0000 (14:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 14 Mar 2024 18:47:26 +0000 (03:47 +0900)
src/shared/ptyfwd.c

index 38b89418cde8bcae8e560b2fe3273165036720e5..bdbd79087ca27238f0ec412d20d83342b4983c0d 100644 (file)
@@ -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();