diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-04-25 04:30:40 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-04-25 04:30:40 +0000 |
commit | 701bec540e909934a46a180c85cb74a038839284 (patch) | |
tree | 96048420aac8117a64e67d90649a07423119d007 /usr.bin | |
parent | 217a00fc27e381acbe59a63f916cc416be3a51f9 (diff) |
fix some minor nits:
o no need to flush stderr as it is not buffered
o use putc to print a newline, not fprintf
o set histchars to be null when we set noglob (and undo of course).
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tset/set.c | 7 | ||||
-rw-r--r-- | usr.bin/tset/term.c | 7 | ||||
-rw-r--r-- | usr.bin/tset/tset.c | 8 |
3 files changed, 10 insertions, 12 deletions
diff --git a/usr.bin/tset/set.c b/usr.bin/tset/set.c index d3093c761ee..ffad7e96fb4 100644 --- a/usr.bin/tset/set.c +++ b/usr.bin/tset/set.c @@ -1,4 +1,4 @@ -/* $OpenBSD: set.c,v 1.2 1996/06/26 05:41:56 deraadt Exp $ */ +/* $OpenBSD: set.c,v 1.3 1998/04/25 04:30:37 millert Exp $ */ /* $NetBSD: set.c,v 1.6 1994/12/07 05:08:10 jtc Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)set.c 8.2 (Berkeley) 2/28/94"; #endif -static char rcsid[] = "$OpenBSD: set.c,v 1.2 1996/06/26 05:41:56 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: set.c,v 1.3 1998/04/25 04:30:37 millert Exp $"; #endif /* not lint */ #include <termios.h> @@ -273,7 +273,6 @@ set_init() if (settle) { (void)putc('\r', stderr); - (void)fflush(stderr); (void)sleep(1); /* Settle the terminal. */ } } @@ -321,7 +320,7 @@ set_tabs() /* Set the tab. */ tputs(set_tab, 0, outc); } - putc('\r', stderr); + (void)putc('\r', stderr); return (1); } return (0); diff --git a/usr.bin/tset/term.c b/usr.bin/tset/term.c index c824a66c371..b52899ad070 100644 --- a/usr.bin/tset/term.c +++ b/usr.bin/tset/term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: term.c,v 1.4 1997/07/25 22:13:24 mickey Exp $ */ +/* $OpenBSD: term.c,v 1.5 1998/04/25 04:30:38 millert Exp $ */ /* $NetBSD: term.c,v 1.6 1994/12/07 05:08:12 jtc Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/9/93"; #endif -static char rcsid[] = "$OpenBSD: term.c,v 1.4 1997/07/25 22:13:24 mickey Exp $"; +static char rcsid[] = "$OpenBSD: term.c,v 1.5 1998/04/25 04:30:38 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -139,11 +139,10 @@ askuser(dflt) (void)fprintf(stderr, "Terminal type? [%s] ", dflt); else (void)fprintf(stderr, "Terminal type? "); - (void)fflush(stderr); if (fgets(answer, sizeof(answer), stdin) == NULL) { if (dflt == NULL) { - (void)fprintf(stderr, "\n"); + (void)putc('\n', stderr); exit(1); } return (dflt); diff --git a/usr.bin/tset/tset.c b/usr.bin/tset/tset.c index 9a236b83b22..87d38d2b4c3 100644 --- a/usr.bin/tset/tset.c +++ b/usr.bin/tset/tset.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tset.c,v 1.4 1997/07/25 22:13:25 mickey Exp $ */ +/* $OpenBSD: tset.c,v 1.5 1998/04/25 04:30:39 millert Exp $ */ /* $NetBSD: tset.c,v 1.4 1994/12/07 05:08:15 jtc Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)tset.c 8.1 (Berkeley) 6/9/93"; #endif -static char rcsid[] = "$OpenBSD: tset.c,v 1.4 1997/07/25 22:13:25 mickey Exp $"; +static char rcsid[] = "$OpenBSD: tset.c,v 1.5 1998/04/25 04:30:39 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -228,8 +228,8 @@ main(argc, argv) */ if ((p = getenv("SHELL")) && !strcmp(p + strlen(p) - 3, "csh")) { - p = "set noglob;\nsetenv TERM %s;\nsetenv TERMCAP '"; - t = "';\nunset noglob;\n"; + p = "set noglob histchars="";\nsetenv TERM %s;\nsetenv TERMCAP '"; + t = "';\nunset noglob histchars;\n"; } else { p = "TERM=%s;\nTERMCAP='"; t = "';\nexport TERMCAP TERM;\n"; |