From: Piero Serini <piero@strider.st.dsi.unimi.it>
authorJordan K. Hubbard <jkh@FreeBSD.org>
Thu, 9 Dec 1993 18:07:45 +0000 (18:07 +0000)
committerJordan K. Hubbard <jkh@FreeBSD.org>
Thu, 9 Dec 1993 18:07:45 +0000 (18:07 +0000)
Message-Id: <199312091710.SAA00967@strider.st.dsi.unimi.it>
Subject: /bin/stty willnot "undef" cchars

Description:
running /bin/stty to change a cchar from its value to <undef>
willnot work, and will set that cchar's value to "u".
Repeat-By:
$ stty discard undef
$ stty -a
...
cchars: discard = u ; dsusp = ^O; eof = ^D; eol = <undef>;

bin/stty/cchar.c

index 458867c..7fd8e26 100644 (file)
@@ -36,6 +36,7 @@ static char sccsid[] = "@(#)cchar.c   5.4 (Berkeley) 6/10/91";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
+#include <sys/unistd.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
@@ -102,8 +103,8 @@ csearch(argvp, ip)
        if (!arg)
                err("option requires an argument -- %s\n%s", name, usage);
 
        if (!arg)
                err("option requires an argument -- %s\n%s", name, usage);
 
-#define CHK(s)  (*name == s[0] && !strcmp(name, s))
-       if (CHK("undef") || CHK("<undef>"))
+#define CHK(s)  (*arg == s[0] && !strcmp(arg, s))
+       if (CHK("undef") || CHK("<undef>")) 
                ip->t.c_cc[cp->sub] = _POSIX_VDISABLE;
        else if (arg[0] == '^')
                ip->t.c_cc[cp->sub] = (arg[1] == '?') ? 0177 :
                ip->t.c_cc[cp->sub] = _POSIX_VDISABLE;
        else if (arg[0] == '^')
                ip->t.c_cc[cp->sub] = (arg[1] == '?') ? 0177 :