]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
format: fix switch case indent
authorjNullj <15849761+jNullj@users.noreply.github.com>
Mon, 27 May 2024 16:21:48 +0000 (19:21 +0300)
committerjNullj <15849761+jNullj@users.noreply.github.com>
Mon, 27 May 2024 16:21:48 +0000 (19:21 +0300)
Linux kernel coding style prefers switch and case at the same indent level.

term-utils/scriptreplay.c

index 1cde3ef769e4367c6a36fd6ac90af02f12109fc8..7535c8586614355de9f1898464c814a5766bd07d 100644 (file)
@@ -323,34 +323,34 @@ main(int argc, char *argv[])
 
        do {
                switch (fgetc(stdin)) {
-                       case ' ':
-                               replay_toggle_pause(setup);
-                               break;
-                       case '\033':
+               case ' ':
+                       replay_toggle_pause(setup);
+                       break;
+               case '\033':
+                       ch = fgetc(stdin);
+                       if (ch == '[') {
                                ch = fgetc(stdin);
-                               if (ch == '[') {
-                                       ch = fgetc(stdin);
-                                       if (ch == 'A') { /* Up arrow */
-                                               divi += 0.1;
-                                               replay_set_delay_div(setup, divi);
-                                       } else if (ch == 'B') { /* Down arrow */
-                                               divi -= 0.1;
-                                               if (divi < 0.1)
-                                                       divi = 0.1;
-                                               replay_set_delay_div(setup, divi);
-                                       } else if (ch == 'C') { /* Right arrow */
-                                               rc = replay_emit_step_data(setup, step, STDOUT_FILENO);
+                               if (ch == 'A') { /* Up arrow */
+                                       divi += 0.1;
+                                       replay_set_delay_div(setup, divi);
+                               } else if (ch == 'B') { /* Down arrow */
+                                       divi -= 0.1;
+                                       if (divi < 0.1)
+                                               divi = 0.1;
+                                       replay_set_delay_div(setup, divi);
+                               } else if (ch == 'C') { /* Right arrow */
+                                       rc = replay_emit_step_data(setup, step, STDOUT_FILENO);
+                                       if (!rc) {
+                                               rc = replay_get_next_step(setup, streams, &step);
                                                if (!rc) {
-                                                       rc = replay_get_next_step(setup, streams, &step);
-                                                       if (!rc) {
-                                                               struct timeval *delay = replay_step_get_delay(step);
-                                                               if (delay && timerisset(delay))
-                                                                       step_delay = *delay;
-                                                       }
+                                                       struct timeval *delay = replay_step_get_delay(step);
+                                                       if (delay && timerisset(delay))
+                                                               step_delay = *delay;
                                                }
                                        }
                                }
-                               break;
+                       }
+                       break;
                }
                if (rc)
                        break;