grub-devel
[Top][All Lists]
Advanced

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

Re: normal/cmdline bug & patch


From: Tomas Ebenlendr
Subject: Re: normal/cmdline bug & patch
Date: Tue, 15 Jun 2004 15:45:17 +0200
User-agent: Mutt/1.5.6i

I missed there, that hist_end is _not_ the last entry, but it is by one
after it. So here is final version of patch:

--- grub2_x/normal/cmdline.c    2004-06-15 15:41:57.000000000 +0200
+++ grub2_patched/normal/cmdline.c      2004-06-15 15:41:22.000000000 +0200
@@ -52,11 +52,11 @@
          int delsize = hist_used - newsize;
          hist_used = newsize;
 
-         for (i = 0; i < delsize; i++)
+         for (i = 1; i <= delsize; i++)
            {
              int pos = hist_end - i;
-             if (pos > hist_size)
-               pos -= hist_size;
+             if (pos < 0)
+               pos += hist_size;
              grub_free (old_hist_lines[pos]);
            }
 
-- 
                                 Tomas 'ebi' Ebenlendr
                                 http://get.to/ebik
                                 PF 2004.45533805151





reply via email to

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