Pārlūkot izejas kodu

Fix the clear_flags command

Due to a typo, it would clear all bits except the HV_Preferred bit.
This commit fixes the bug, and refactors the clearing code to make typos
like this harder to make.
Clara Hobbs 6 gadus atpakaļ
vecāks
revīzija
405fd466f2
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3
    3
      src/shell.c

+ 3
- 3
src/shell.c Parādīt failu

@@ -257,9 +257,9 @@ static void cmd_clear_flags(BaseSequentialStream *chp, int argc, char *argv[])
257 257
     }
258 258
 
259 259
     /* Clear all flags that can be toggled with toggle_* commands */
260
-    tmpcfg.flags &= ~PDBS_CONFIG_FLAGS_GIVEBACK
261
-        & ~PDBS_CONFIG_FLAGS_VAR_BAT
262
-        & PDBS_CONFIG_FLAGS_HV_PREFERRED;
260
+    tmpcfg.flags &= ~(PDBS_CONFIG_FLAGS_GIVEBACK
261
+            | PDBS_CONFIG_FLAGS_VAR_BAT
262
+            | PDBS_CONFIG_FLAGS_HV_PREFERRED);
263 263
 }
264 264
 
265 265
 static void cmd_toggle_giveback(BaseSequentialStream *chp, int argc, char *argv[])

Notiek ielāde…
Atcelt
Saglabāt