hdt: Setting up a flag to disable more_printf
authorErwan Velu <erwan.velu@free.fr>
Wed, 4 Nov 2009 20:03:44 +0000 (21:03 +0100)
committerErwan Velu <erwan.velu@free.fr>
Wed, 4 Nov 2009 20:03:44 +0000 (21:03 +0100)
Impact: None.

Some modes could requires disabling more_printf

com32/hdt/hdt-common.h
com32/hdt/hdt.c

index baecbc0..0e7f122 100644 (file)
@@ -67,6 +67,7 @@
 #define AUTO_DELIMITER "'"
 
 extern int display_line_nb;
+extern bool disable_more_printf;
 
 #define pause_printf() do {\
        printf("--More--");\
@@ -79,14 +80,16 @@ extern int display_line_nb;
  * one \n (and only one)
  */
 #define more_printf(...) do {\
- if (display_line_nb == 20) {\
-   printf("\n--More--");\
+ if (!disable_more_printf) {\
+  if (display_line_nb == 20) {\
    display_line_nb=0;\
+   printf("\n--More--");\
    get_key(stdin, 0);\
    printf("\033[2K\033[1G\033[1F");\
+  }\
+  display_line_nb++;\
  }\
  printf(__VA_ARGS__);\
- display_line_nb++;\
 } while (0);
 
 /* Display CPU registers for debugging purposes */
index 00c5439..0fe2021 100644 (file)
@@ -40,6 +40,7 @@
 #include "hdt-common.h"
 
 int display_line_nb = 0;
+bool disable_more_printf = false;
 
 int main(const int argc, const char *argv[])
 {