Fixed backspace and delete so they work properly again -- broken
authorEric Andersen <andersen@codepoet.org>
Thu, 6 Jul 2000 21:29:32 +0000 (21:29 -0000)
committerEric Andersen <andersen@codepoet.org>
Thu, 6 Jul 2000 21:29:32 +0000 (21:29 -0000)
since 0.44.
 -Erik

Changelog
init.c
init/init.c

index 981324308749310acc2efaee936e9fae211270b7..f9d385622ca1e45ddc42896799dfcff40c744693 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -29,6 +29,9 @@
            Matt Kraai <kraai@alumni.carnegiemellon.edu>.
        * Reorganized signal names in kill.c for better architecture support 
            -- patch thanks to simon wood <simon@mungewell.uklinux.net>
+       * In 0.43, backspace and delete worked properly, but with 0.45, 
+           it just echoed a ^? for backspace, and ^H for control-h.  This
+           was due to a broken macro in init.c, that is now fixed.
 
 
         -Erik Andersen
diff --git a/init.c b/init.c
index c960fe333ddbee7079436702062a51175e323b1f..0f6a9bc9b27487b71d2f268e54abe15a5ff8e89f 100644 (file)
--- a/init.c
+++ b/init.c
@@ -224,7 +224,7 @@ static void message(int device, char *fmt, ...)
        }
 }
 
-#define CTRLCHAR(ch)   ((ch)&0x1f)
+#define CTRLCHAR(ch)   ((ch)-0x40)
 
 /* Set terminal settings to reasonable defaults */
 void set_term(int fd)
@@ -242,7 +242,7 @@ void set_term(int fd)
        tty.c_cc[VSTART] = CTRLCHAR('Q');       /* Ctrl-Q */
        tty.c_cc[VSTOP]  = CTRLCHAR('S');       /* Ctrl-S */
        tty.c_cc[VSUSP]  = CTRLCHAR('Z');       /* Ctrl-Z */
-       
+
        /* use line dicipline 0 */
        tty.c_line = 0;
 
index c960fe333ddbee7079436702062a51175e323b1f..0f6a9bc9b27487b71d2f268e54abe15a5ff8e89f 100644 (file)
@@ -224,7 +224,7 @@ static void message(int device, char *fmt, ...)
        }
 }
 
-#define CTRLCHAR(ch)   ((ch)&0x1f)
+#define CTRLCHAR(ch)   ((ch)-0x40)
 
 /* Set terminal settings to reasonable defaults */
 void set_term(int fd)
@@ -242,7 +242,7 @@ void set_term(int fd)
        tty.c_cc[VSTART] = CTRLCHAR('Q');       /* Ctrl-Q */
        tty.c_cc[VSTOP]  = CTRLCHAR('S');       /* Ctrl-S */
        tty.c_cc[VSUSP]  = CTRLCHAR('Z');       /* Ctrl-Z */
-       
+
        /* use line dicipline 0 */
        tty.c_line = 0;