]> granicus.if.org Git - neomutt/commitdiff
Do not interrupt switch fallthrough 1285/head
authorAustin Ray <austin@austinray.io>
Thu, 5 Jul 2018 03:32:23 +0000 (23:32 -0400)
committerAustin Ray <austin@austinray.io>
Thu, 5 Jul 2018 03:32:23 +0000 (23:32 -0400)
Commit e85c735 introduced the `<check-stats>` function, designated by
`OP_CHECK_STATS`.

This had been inserted below `OP_MAIN_CHANGE_VFOLDER`, which is
`change-vfolder`'s designation; however, `OP_MAIN_CHANGE_VFOLDER` relies
on C's switch fallthrough logic to execute. As a result,
`change-vfolder` executed `check-stats`'s logic instead of the correct
logic.

This commit moves `OP_CHECK_STATS` to above the #ifdef that
`OP_MAIN_CHANGE_VFOLDER` is defined in.

curs_main.c

index 1a2ccbb12610cac1ac6a3d00e6e269d3bcbc4299..e2fc119d8b2ad156a00806e6c59e293b87575397 100644 (file)
@@ -1905,6 +1905,10 @@ int mutt_index_menu(void)
         break;
       }
 
+      case OP_CHECK_STATS:
+        mutt_check_stats();
+        break;
+
 #ifdef USE_NOTMUCH
       case OP_MAIN_VFOLDER_FROM_QUERY:
         buf[0] = '\0';
@@ -1964,10 +1968,6 @@ int mutt_index_menu(void)
       case OP_MAIN_CHANGE_VFOLDER:
 #endif
 
-      case OP_CHECK_STATS:
-        mutt_check_stats();
-        break;
-
 #ifdef USE_SIDEBAR
       case OP_SIDEBAR_OPEN:
 #endif