]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Replace line counter with char counter
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 23 Mar 2010 15:51:53 +0000 (16:51 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 23 Mar 2010 15:51:53 +0000 (16:51 +0100)
include/grub/normal.h
normal/menu.c
normal/term.c

index 6ec14d31a1423bfaa4ce64313bd7b0e05e738101..a5352cdcfe5530db32ac41af7731ab0f77d0b3e2 100644 (file)
@@ -112,7 +112,7 @@ void read_terminal_list (void);
 
 void grub_set_more (int onoff);
 
-int grub_normal_get_line_counter (void);
+int grub_normal_get_char_counter (void);
 void grub_install_newline_hook (void);
 
 void grub_xputs_normal (const char *str);
index e96c99efdb82a31568de8509f0bcb078be7db653..60311970f296f9c4f80075f1e7bf9945848663ab 100644 (file)
@@ -558,13 +558,13 @@ show_menu (grub_menu_t menu, int nested)
         }
       else
         {
-         int lines_before = grub_normal_get_line_counter ();
+         int chars_before = grub_normal_get_char_counter ();
           grub_errno = GRUB_ERR_NONE;
           grub_menu_execute_entry (e);
          grub_print_error ();
          grub_errno = GRUB_ERR_NONE;
 
-          if (lines_before != grub_normal_get_line_counter ())
+          if (chars_before != grub_normal_get_char_counter ())
            grub_wait_after_message ();
         }
     }
index 9488f68bc656b9c46bbad231b7412b17710a4cf9..493127b659a1d395732913bbf2d8a91fd3ad2f6e 100644 (file)
 #include <grub/normal.h>
 #include <grub/charset.h>
 
+struct term_state
+{
+  struct term_state *next;
+  struct grub_unicode_glyph *backlog;
+  int numlines;
+  char *term_name;
+};
+
 /* The amount of lines counted by the pager.  */
 static unsigned grub_more_lines;
 
 /* If the more pager is active.  */
 static int grub_more;
 
-static int grub_normal_line_counter = 0;
+static int grub_normal_char_counter = 0;
 
 int
-grub_normal_get_line_counter (void)
+grub_normal_get_char_counter (void)
 {
-  return grub_normal_line_counter;
+  return grub_normal_char_counter;
 }
 
 static void
@@ -50,8 +58,6 @@ process_newline (void)
       height = grub_term_height (cur);
   grub_more_lines++;
 
-  grub_normal_line_counter++;
-
   if (grub_more && grub_more_lines >= height - 1)
     {
       char key;
@@ -340,6 +346,8 @@ putglyph (const struct grub_unicode_glyph *c, struct grub_term_output *term)
       .estimated_width = 1
     };
 
+  grub_normal_char_counter++;
+
   if (c->base == '\t' && term->getxy)
     {
       int n;