bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in the --nocurses mode


From: Klaus Reichl
Subject: bug in the --nocurses mode
Date: Tue, 19 Feb 2002 09:57:01 +0100 (MET)

>>>>> "Stanislav" == Stanislav Ievlev <address@hidden> writes:

    Stanislav> Hello all!
    Stanislav> I've discovered a strange bug when I'm running grub
    Stanislav> with --no-curses option: 
    Stanislav> ---------------------------
    Stanislav> This is only in GRUB 0.91. In GRUB 0.90 all worked well.

    ...

    Stanislav> As I understand this is a problem in DUMB_TERMINAL
    Stanislav> mode. Your are change it since 0.90 .
    Stanislav> ----------------------------------------
    Stanislav> With best regards
    Stanislav> Stanislav Ievlev.

Hi Stanislav, hi NON-CURSES & DUMB_TERMINAL hackers,

You're right.  We (that means really I) made a mistake with
DUMB_TERMINALs, when it comes to long lines (lines longer than
CMDLINE_WIDTH = 78).

The good thing is, that the bug doesn't compromise grub's logic, so
commands which are typed in are correctly executed, only the display
(echoing) logic, leading to echoing the same line again and again, is
wrong. 

The bad thing is, it's a bug, which again told us that the
implementation of various terminals via if here and if there is a
unmaintainable mess.  Okuji suggested, that we should significantly
rewrite the terminal handling code (see discussions on
DUMB_TERMINAL), the question, however, is, who and when.

Inline with what I've said above here's a kludge rather than a fix
(one if more on terminal, I agree with Okuji).

Thanks for the report,
KR
--
Klaus Reichl                        voice: +43 (1) 27722 / 3884
Alcatel Austria AG/RTPT             fax:   +43 (1) 27722 / 3955
Scheydgasse 41                      inet:  address@hidden
A-1210 Wien, Austria/Europe

Index: stage2/char_io.c
===================================================================
RCS file: /cvsroot/grub/grub/stage2/char_io.c,v
retrieving revision 1.44
diff -u -r1.44 char_io.c
--- stage2/char_io.c    18 Jan 2002 17:16:44 -0000      1.44
+++ stage2/char_io.c    31 Jan 2002 13:33:20 -0000
@@ -523,12 +523,17 @@
          
          llen += l;
          lpos += l;
-         if (xpos + l >= CMDLINE_WIDTH)
-           cl_refresh (1, 0);
-         else if (xpos + l + llen - lpos > CMDLINE_WIDTH)
-           cl_refresh (0, CMDLINE_WIDTH - xpos);
-         else
+         if (terminal & TERMINAL_DUMB)
            cl_refresh (0, l + llen - lpos);
+         else
+           {
+             if (xpos + l >= CMDLINE_WIDTH)
+               cl_refresh (1, 0);
+             else if (xpos + l + llen - lpos > CMDLINE_WIDTH)
+               cl_refresh (0, CMDLINE_WIDTH - xpos);
+             else
+               cl_refresh (0, l + llen - lpos);
+           }
        }
     }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]