]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
fix two bugs in the command setkey and start.S.
authorokuji <okuji@localhost>
Mon, 9 Oct 2000 16:32:59 +0000 (16:32 +0000)
committerokuji <okuji@localhost>
Mon, 9 Oct 2000 16:32:59 +0000 (16:32 +0000)
ChangeLog
THANKS
stage2/builtins.c
stage2/start.S

index d4bd9ac278906798a956f42bde933c923d876433..593cc4cf78f269dd2670bc74f872982fc0feb44e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2000-10-10  OKUJI Yoshinori  <okuji@gnu.org>
+
+       * stage2/start.S (copy_buffer): Use pusha and popa instead of
+       pushing and poping %di and %si individually, to reduce the code
+       size and save %cx as well. Reported by Herbert Nachtnebel
+       <nachtneb@iaee.tuwien.ac.at>.
+       
+2000-10-10  OKUJI Yoshinori  <okuji@gnu.org>
+
+       From Daniel Pittman <daniel@rimspace.net>:
+       * stage2/builtins.c (setkey_func): Check if
+       KEYSYM_TABLE[I].UNSHIFTED_NAME and KEYSYM_TABLE[I].SHIFTED_NAME
+       are not NULLs, before calling grub_strcmp.
+       
 2000-10-08  OKUJI Yoshinori  <okuji@gnu.org>
 
        * util/grub-install.in (grub_prefix): New variable. The default
diff --git a/THANKS b/THANKS
index 4f5e558b409e393f81563c0d3a53283e49fd00a6..df14bc76ecb505a34656be39d87de8a0814cd4ca 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -15,6 +15,7 @@ Bryan Ford <baford@cs.utah.edu>
 Chip Salzenberg <chip@valinux.com>
 Christoph Plattner <Christoph.Plattner@dot.at>
 Dan J. Walters <djw@cs.utexas.edu>
+Daniel Pittman <daniel@rimspace.net>
 Daniel Wagner <wagi@gmx.ch>
 Edmund GRIMLEY EVANS <edmundo@rano.demon.co.uk>
 Edward Killips <ekillips@triton.net>
@@ -23,6 +24,7 @@ Frank Mehnert <fm3@os.inf.tu-dresden.de>
 Goran Koruga <goran.koruga@hermes.si>
 Hal Snyder <hal@vailsys.com>
 Heiko Schroeder <heiko@pool.informatik.rwth-aachen.de>
+Herbert Nachtnebel <nachtneb@iaee.tuwien.ac.at>
 Hisazumi Kenji <nel@soraneko.com>
 Jochen Hoenicke <jochen@gnu.org>
 Johannes Kroeger <hanne@squirrel.owl.de>
index 60289b467a0ec0073d1289da7d48181452a81ea5..5eee56dfa94e4f15d69de5f7b107bf4cf8156577 100644 (file)
@@ -3182,24 +3182,28 @@ setkey_func (char *arg, int flags)
 
       for (i = 0; i < sizeof (keysym_table) / sizeof (keysym_table[0]); i++)
        {
-         if (grub_strcmp (key, keysym_table[i].unshifted_name) == 0)
+         if (keysym_table[i].unshifted_name &&
+             grub_strcmp (key, keysym_table[i].unshifted_name) == 0)
            return keysym_table[i].keycode;
-         else if (grub_strcmp (key, keysym_table[i].shifted_name) == 0)
+         else if (keysym_table[i].shifted_name &&
+                  grub_strcmp (key, keysym_table[i].shifted_name) == 0)
            return keysym_table[i].keycode;
        }
-
+      
       return 0;
     }
-
+  
   static int find_ascii_code (char *key)
     {
       int i;
-
+      
       for (i = 0; i < sizeof (keysym_table) / sizeof (keysym_table[0]); i++)
        {
-         if (grub_strcmp (key, keysym_table[i].unshifted_name) == 0)
+         if (keysym_table[i].unshifted_name &&
+             grub_strcmp (key, keysym_table[i].unshifted_name) == 0)
            return keysym_table[i].unshifted_ascii;
-         else if (grub_strcmp (key, keysym_table[i].shifted_name) == 0)
+         else if (keysym_table[i].shifted_name &&
+                  grub_strcmp (key, keysym_table[i].shifted_name) == 0)
            return keysym_table[i].shifted_ascii;
        }
       
@@ -3208,10 +3212,10 @@ setkey_func (char *arg, int flags)
   
   to_key = arg;
   from_key = skip_to (0, to_key);
-
+  
   nul_terminate (to_key);
   nul_terminate (from_key);
-
+  
   to_code = find_ascii_code (to_key);
   from_code = find_ascii_code (from_key);
   if (! to_code || ! from_code)
@@ -3225,7 +3229,7 @@ setkey_func (char *arg, int flags)
          return 1;
        }
     }
-
+  
   if (map_in_interrupt)
     {
       int i;
@@ -3249,7 +3253,8 @@ setkey_func (char *arg, int flags)
       
       if (to_code == from_code)
        /* If TO is equal to FROM, delete the entry.  */
-       grub_memmove ((char *) &bios_key_map[i], (char *) &bios_key_map[i + 1],
+       grub_memmove ((char *) &bios_key_map[i],
+                     (char *) &bios_key_map[i + 1],
                      sizeof (unsigned short) * (KEY_MAP_SIZE - i));
       else
        bios_key_map[i] = (to_code << 8) | from_code;
index b96900d759f72f65051e05f4f274752fefad2b7a..c0877757a1b2dc60d3c946c7d42ebedd8bea8425 100644 (file)
@@ -279,15 +279,14 @@ copy_buffer:
        addw    %ax, 6(%di)     /* add the corrected value to the destination
                                   address for next time */
 
+       /* save addressing regs */
+       pusha
+       pushw   %ds
+
        /* get the copy length */
        shlw    $4, %ax
        movw    %ax, %cx
 
-       /* save addressing regs */
-       pushw   %si
-       pushw   %di
-       pushw   %ds
-
        xorw    %di, %di        /* zero offset of destination addresses */
        xorw    %si, %si        /* zero offset of source addresses */
        movw    %bx, %ds        /* restore the source segment */
@@ -302,8 +301,7 @@ copy_buffer:
           (MSG modifies SI, which is saved, and unused AX and BX) */
        popw    %ds
        MSG(notification_step)
-       popw    %di
-       popw    %si
+       popa
 
        /* check if finished with this dataset */
        cmpw    $0, 4(%di)