CVS commit: src/usr.bin/tip

2020-04-22 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Apr 23 00:35:14 UTC 2020

Modified Files:
src/usr.bin/tip: tip.c tip.h

Log Message:
Avoid using common symbol definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/tip/tip.c
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/tip/tip.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.62 src/usr.bin/tip/tip.c:1.63
--- src/usr.bin/tip/tip.c:1.62	Thu Feb 28 17:41:27 2019
+++ src/usr.bin/tip/tip.c	Thu Apr 23 00:35:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.62 2019/02/28 17:41:27 gson Exp $	*/
+/*	$NetBSD: tip.c,v 1.63 2020/04/23 00:35:14 joerg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)tip.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: tip.c,v 1.62 2019/02/28 17:41:27 gson Exp $");
+__RCSID("$NetBSD: tip.c,v 1.63 2020/04/23 00:35:14 joerg Exp $");
 #endif /* not lint */
 
 /*
@@ -54,6 +54,70 @@ __RCSID("$NetBSD: tip.c,v 1.62 2019/02/2
 #include "tip.h"
 #include "pathnames.h"
 
+struct termios	term;
+struct termios	defterm;
+struct termios	defchars;
+
+FILE	*fscript;
+
+int	attndes[2];
+int	fildes[2];
+int	repdes[2];
+int	FD;
+#ifndef __lint__  /* not used by hayes.c, but used by some other dialers */
+int	AC;
+#endif /*__lint__*/
+int	sfd;
+int	pid;
+uid_t	uid, euid;
+gid_t	gid, egid;
+int	stop;
+int	quit;
+int	stoprompt;
+int	timedout;
+int	cumode;
+int	bits8;
+#define STRIP_PAR	(bits8 ? 0377 : 0177)
+
+char	fname[80];
+char	copyname[80];
+char	ccc;
+
+int	odisc;
+int	vflag;
+
+char	*DV;
+char	*EL;
+char	*CM;
+char	*IE;
+char	*OE;
+char	*CU;
+char	*AT;
+char	*PN;
+char	*DI;
+char	*PA;
+
+char	*PH;
+char	*RM;
+char	*HO;
+
+long	BR;
+long	FS;
+
+long	DU;
+long	HW;
+char	*ES;
+char	*EX;
+char	*FO;
+char	*RC;
+char	*RE;
+char	*PR;
+long	DL;
+long	CL;
+long	ET;
+long	HD;
+char	DC;
+
 __dead static void	tipusage(void);
 
 int	escape(void);

Index: src/usr.bin/tip/tip.h
diff -u src/usr.bin/tip/tip.h:1.33 src/usr.bin/tip/tip.h:1.34
--- src/usr.bin/tip/tip.h:1.33	Mon Oct 21 14:47:46 2013
+++ src/usr.bin/tip/tip.h	Thu Apr 23 00:35:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.h,v 1.33 2013/10/21 14:47:46 christos Exp $	*/
+/*	$NetBSD: tip.h,v 1.34 2020/04/23 00:35:14 joerg Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -59,37 +59,37 @@
 /*
  * Remote host attributes
  */
-char	*DV;			/* UNIX device(s) to open */
-char	*EL;			/* chars marking an EOL */
-char	*CM;			/* initial connection message */
-char	*IE;			/* EOT to expect on input */
-char	*OE;			/* EOT to send to complete FT */
-char	*CU;			/* call unit if making a phone call */
-char	*AT;			/* acu type */
-char	*PN;			/* phone number(s) */
-char	*DI;			/* disconnect string */
-char	*PA;			/* parity to be generated */
-
-char	*PH;			/* phone number file */
-char	*RM;			/* remote file name */
-char	*HO;			/* host name */
-
-long	BR;			/* line speed for conversation */
-long	FS;			/* frame size for transfers */
-
-long	DU;			/* this host is dialed up */
-long	HW;			/* this device is hardwired, see hunt.c */
-char	*ES;			/* escape character */
-char	*EX;			/* exceptions */
-char	*FO;			/* force (literal next) char*/
-char	*RC;			/* raise character */
-char	*RE;			/* script record file */
-char	*PR;			/* remote prompt */
-long	DL;			/* line delay for file transfers to remote */
-long	CL;			/* char delay for file transfers to remote */
-long	ET;			/* echocheck timeout */
-long	HD;			/* this host is half duplex - do local echo */
-char	DC;			/* this host is directly connected. */
+extern char	*DV;			/* UNIX device(s) to open */
+extern char	*EL;			/* chars marking an EOL */
+extern char	*CM;			/* initial connection message */
+extern char	*IE;			/* EOT to expect on input */
+extern char	*OE;			/* EOT to send to complete FT */
+extern char	*CU;			/* call unit if making a phone call */
+extern char	*AT;			/* acu type */
+extern char	*PN;			/* phone number(s) */
+extern char	*DI;			/* disconnect string */
+extern char	*PA;			/* parity to be generated */
+
+extern char	*PH;			/* phone number file */
+extern char	*RM;			/* remote file name */
+extern char	*HO;			/* host name */
+
+extern long	BR;			/* line speed for conversation */
+extern long	FS;			/* frame size for transfers */
+
+extern long	DU;			/* this host is dialed up */
+extern long	HW;			/* this device is hardwired, see hunt.c */
+extern char	*ES;			/* escape character */
+extern char	*EX;			/* exceptions */
+extern char	*FO;			/* force (literal next) char*/
+extern char	*RC;			/* raise character */
+extern char	*RE;			/* script record file */
+extern char	*PR;			/* remote prompt */
+extern long	DL;			/* line delay for file transfers to remote */
+extern long	CL;			/* char delay for file transfers to remote */
+extern long	ET;			/* echocheck timeout */
+extern long	HD;			/* this 

CVS commit: src/usr.bin/tip

2019-02-28 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Feb 28 17:41:27 UTC 2019

Modified Files:
src/usr.bin/tip: tip.c

Log Message:
Make xgetchar() return an int like getchar() does, and remove needless cast.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/tip/tip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.61 src/usr.bin/tip/tip.c:1.62
--- src/usr.bin/tip/tip.c:1.61	Fri Feb 22 22:25:22 2019
+++ src/usr.bin/tip/tip.c	Thu Feb 28 17:41:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.61 2019/02/22 22:25:22 uwe Exp $	*/
+/*	$NetBSD: tip.c,v 1.62 2019/02/28 17:41:27 gson Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)tip.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: tip.c,v 1.61 2019/02/22 22:25:22 uwe Exp $");
+__RCSID("$NetBSD: tip.c,v 1.62 2019/02/28 17:41:27 gson Exp $");
 #endif /* not lint */
 
 /*
@@ -332,7 +332,7 @@ intprompt(int dummy __unused)
 /*
  * getchar() wrapper that checks for EOF on the local end.
  */
-static char
+static int
 xgetchar(void)
 {
 	int c = getchar();
@@ -341,7 +341,7 @@ xgetchar(void)
 		/* NOTREACHED */
 	}
 
-	return (char)c & STRIP_PAR;
+	return c & STRIP_PAR;
 }
 
 



CVS commit: src/usr.bin/tip

2019-02-22 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Feb 22 22:25:22 UTC 2019

Modified Files:
src/usr.bin/tip: tip.c

Log Message:
Check getchar() result for EOF.

Call cleanup(SIGHUP) if we get local EOF, as if we've got SIGHUP.
While here, use EOF constant instead of literal -1 in an existing
check.

PR bin/53996


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/tip/tip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.60 src/usr.bin/tip/tip.c:1.61
--- src/usr.bin/tip/tip.c:1.60	Wed Feb  6 14:08:50 2019
+++ src/usr.bin/tip/tip.c	Fri Feb 22 22:25:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.60 2019/02/06 14:08:50 rin Exp $	*/
+/*	$NetBSD: tip.c,v 1.61 2019/02/22 22:25:22 uwe Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)tip.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: tip.c,v 1.60 2019/02/06 14:08:50 rin Exp $");
+__RCSID("$NetBSD: tip.c,v 1.61 2019/02/22 22:25:22 uwe Exp $");
 #endif /* not lint */
 
 /*
@@ -304,7 +304,7 @@ prompt(const char *s, char *volatile p, 
 	unraw();
 	(void)printf("%s", s);
 	if (setjmp(promptbuf) == 0)
-		while ((c = getchar()) != -1 && (*p = c) != '\n' &&
+		while ((c = getchar()) != EOF && (*p = c) != '\n' &&
 		b + l > p)
 			p++;
 	*p = '\0';
@@ -330,6 +330,22 @@ intprompt(int dummy __unused)
 }
 
 /*
+ * getchar() wrapper that checks for EOF on the local end.
+ */
+static char
+xgetchar(void)
+{
+	int c = getchar();
+	if (__predict_false(c == EOF)) {
+		cleanup(SIGHUP);
+		/* NOTREACHED */
+	}
+
+	return (char)c & STRIP_PAR;
+}
+
+
+/*
  * TIPIN   TIPIN
  */
 static void
@@ -350,7 +366,7 @@ tipin(void)
 	}
 
 	for (;;) {
-		gch = getchar()_PAR;
+		gch = xgetchar();
 		if ((gch == character(value(ESCAPE))) && bol) {
 			if (!(gch = escape()))
 continue;
@@ -365,7 +381,7 @@ tipin(void)
 (void)printf("%s\n", gch == '\r' ? "\r" : "");
 			continue;
 		} else if (!cumode && gch && gch == character(value(FORCE)))
-			gch = getchar()_PAR;
+			gch = xgetchar();
 		bol = any(gch, value(EOL));
 		if (boolean(value(RAISE)) && islower((unsigned char)gch))
 			gch = toupper((unsigned char)gch);
@@ -386,7 +402,7 @@ escape(void)
 	esctable_t *p;
 	char c = character(value(ESCAPE));
 
-	gch = (getchar()_PAR);
+	gch = xgetchar();
 	for (p = etable; p->e_char; p++)
 		if (p->e_char == gch) {
 			if ((p->e_flags) && uid)



CVS commit: src/usr.bin/tip

2019-02-06 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Feb  6 14:08:50 UTC 2019

Modified Files:
src/usr.bin/tip: tip.c

Log Message:
Make cu(1) and tip(1) recognize newline (^J) as end-of-line.
Now, tilde (~) after newline works as escape character as in ssh(1).
No objections when proposed on tech-userland.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/usr.bin/tip/tip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.59 src/usr.bin/tip/tip.c:1.60
--- src/usr.bin/tip/tip.c:1.59	Mon Sep  5 00:40:30 2016
+++ src/usr.bin/tip/tip.c	Wed Feb  6 14:08:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.59 2016/09/05 00:40:30 sevan Exp $	*/
+/*	$NetBSD: tip.c,v 1.60 2019/02/06 14:08:50 rin Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)tip.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: tip.c,v 1.59 2016/09/05 00:40:30 sevan Exp $");
+__RCSID("$NetBSD: tip.c,v 1.60 2019/02/06 14:08:50 rin Exp $");
 #endif /* not lint */
 
 /*
@@ -358,11 +358,11 @@ tipin(void)
 		gch && gch == character(value(RAISECHAR))) {
 			setboolean(value(RAISE), !boolean(value(RAISE)));
 			continue;
-		} else if (gch == '\r') {
+		} else if (gch == '\r' || gch == '\n') {
 			bol = 1;
 			xpwrite(FD, , 1);
 			if (boolean(value(HALFDUPLEX)))
-(void)printf("\r\n");
+(void)printf("%s\n", gch == '\r' ? "\r" : "");
 			continue;
 		} else if (!cumode && gch && gch == character(value(FORCE)))
 			gch = getchar()_PAR;



CVS commit: src/usr.bin/tip/aculib

2016-06-29 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Jun 30 05:56:46 UTC 2016

Modified Files:
src/usr.bin/tip/aculib: v831.c

Log Message:
PR 51192 David Binderman: fix wrong logic (probably)

XXX: this file should probably just be deleted


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/tip/aculib/v831.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/aculib/v831.c
diff -u src/usr.bin/tip/aculib/v831.c:1.12 src/usr.bin/tip/aculib/v831.c:1.13
--- src/usr.bin/tip/aculib/v831.c:1.12	Thu Dec 14 17:09:43 2006
+++ src/usr.bin/tip/aculib/v831.c	Thu Jun 30 05:56:46 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: v831.c,v 1.12 2006/12/14 17:09:43 christos Exp $	*/
+/*	$NetBSD: v831.c,v 1.13 2016/06/30 05:56:46 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)v831.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: v831.c,v 1.12 2006/12/14 17:09:43 christos Exp $");
+__RCSID("$NetBSD: v831.c,v 1.13 2016/06/30 05:56:46 dholland Exp $");
 #endif /* not lint */
 
 /*
@@ -249,7 +249,7 @@ sanitize(char *s)
 char *cp;
 
 for (cp = buf; *s && buf + sizeof buf - cp > 1; s++) {
-		if (!isdigit((unsigned char)*s) && *s == '<' && *s != '_')
+		if (!isdigit((unsigned char)*s) && *s != '<' && *s != '_')
 			continue;
 		if (*s == '_')
 			*s = '=';



CVS commit: src/usr.bin/tip

2016-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan  3 15:38:29 UTC 2016

Modified Files:
src/usr.bin/tip: cu.c

Log Message:
Put back -n


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/tip/cu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/cu.c
diff -u src/usr.bin/tip/cu.c:1.22 src/usr.bin/tip/cu.c:1.23
--- src/usr.bin/tip/cu.c:1.22	Sun Jul 27 00:32:23 2014
+++ src/usr.bin/tip/cu.c	Sun Jan  3 10:38:29 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cu.c,v 1.22 2014/07/27 04:32:23 dholland Exp $	*/
+/*	$NetBSD: cu.c,v 1.23 2016/01/03 15:38:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -36,7 +36,7 @@
 #if 0
 static char sccsid[] = "@(#)cu.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: cu.c,v 1.22 2014/07/27 04:32:23 dholland Exp $");
+__RCSID("$NetBSD: cu.c,v 1.23 2016/01/03 15:38:29 christos Exp $");
 #endif /* not lint */
 
 #include "tip.h"
@@ -54,7 +54,7 @@ cumain(int argc, char *argv[])
 	int parity = 0;		/* 0 is no parity */
 	int flow = -1;		/* -1 is "tandem" ^S/^Q */
 	static int helpme = 0, nostop = 0;
-	char useresc = '~';
+	int useresc = '~';
 	static char sbuf[12];
 	int cmdlineBR;
 	extern char *optarg;
@@ -84,7 +84,7 @@ cumain(int argc, char *argv[])
 	cmdlineBR = 0;
 
 	while((c = getopt_long(argc, argv,
-	"E:F:P:a:p:c:l:s:hefot0123456789", longopts, NULL)) != -1) {
+	"E:F:P:a:p:c:l:ns:hefot0123456789", longopts, NULL)) != -1) {
 
 		if (helpme == 1) cuhelp();
 
@@ -136,6 +136,9 @@ cumain(int argc, char *argv[])
 			else
 (void)asprintf(, "/dev/%s", optarg);
 			break;
+		case 'n':
+			useresc = -1;
+			break;
 		case 's':
 			BR = atoi(optarg);
 			break;
@@ -296,6 +299,7 @@ cuhelp(void)
 	" -o: Use odd parity\n"
 	" -P,--parity {even,odd,none}: use even, odd, no parity\n"
 	" -l,--line line: Use this device (ttyXX)\n"
+	" -n: Disable escape character processing\n"
 	" -s,--speed,--baud speed,-#: Use this speed\n"
 	" -t: Connect via hard-wired connection\n");
 	exit(0);



CVS commit: src/usr.bin/tip

2015-06-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jun 17 01:38:02 UTC 2015

Modified Files:
src/usr.bin/tip: tip.c

Log Message:
add missing quote, remove some braces.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/usr.bin/tip/tip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.57 src/usr.bin/tip/tip.c:1.58
--- src/usr.bin/tip/tip.c:1.57	Tue Jun 16 18:54:11 2015
+++ src/usr.bin/tip/tip.c	Tue Jun 16 21:38:02 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.57 2015/06/16 22:54:11 christos Exp $	*/
+/*	$NetBSD: tip.c,v 1.58 2015/06/17 01:38:02 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)tip.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: tip.c,v 1.57 2015/06/16 22:54:11 christos Exp $);
+__RCSID($NetBSD: tip.c,v 1.58 2015/06/17 01:38:02 christos Exp $);
 #endif /* not lint */
 
 /*
@@ -87,12 +87,11 @@ main(int argc, char *argv[])
 		goto cucommon;
 	}
 
-	if (argc  4) {
+	if (argc  4)
 		tipusage();
-	}
-	if (!isatty(0)) {
-		errx(EXIT_FAILURE, must be interactive);
-	}
+
+	if (!isatty(0))
+		errx(EXIT_FAILURE, must be interactive);
 
 	cmdlineBR = 0;
 	while((c = getopt(argc, argv, v0123456789)) != -1) {



CVS commit: src/usr.bin/tip

2015-06-11 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Thu Jun 11 18:12:00 UTC 2015

Modified Files:
src/usr.bin/tip: tip.c

Log Message:
Don't call exit() from a signal handler, as it's not async-signal-safe;
use _exit() instead.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.bin/tip/tip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.55 src/usr.bin/tip/tip.c:1.56
--- src/usr.bin/tip/tip.c:1.55	Sun Jul 27 04:32:23 2014
+++ src/usr.bin/tip/tip.c	Thu Jun 11 18:12:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.55 2014/07/27 04:32:23 dholland Exp $	*/
+/*	$NetBSD: tip.c,v 1.56 2015/06/11 18:12:00 gson Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)tip.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: tip.c,v 1.55 2014/07/27 04:32:23 dholland Exp $);
+__RCSID($NetBSD: tip.c,v 1.56 2015/06/11 18:12:00 gson Exp $);
 #endif /* not lint */
 
 /*
@@ -264,7 +264,7 @@ cleanup(int dummy __unused)
 
 	if (odisc)
 		(void)ioctl(0, TIOCSETD, odisc);
-	exit(0);
+	_exit(0);
 }
 
 /*



CVS commit: src/usr.bin/tip

2014-07-26 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sun Jul 27 04:32:23 UTC 2014

Modified Files:
src/usr.bin/tip: cu.c tip.c

Log Message:
Remove broken snprintf usage (noted in PR 47976) and replace with
something simpler.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/tip/cu.c
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/tip/tip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/cu.c
diff -u src/usr.bin/tip/cu.c:1.21 src/usr.bin/tip/cu.c:1.22
--- src/usr.bin/tip/cu.c:1.21	Tue Sep  6 18:33:01 2011
+++ src/usr.bin/tip/cu.c	Sun Jul 27 04:32:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cu.c,v 1.21 2011/09/06 18:33:01 joerg Exp $	*/
+/*	$NetBSD: cu.c,v 1.22 2014/07/27 04:32:23 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -36,7 +36,7 @@
 #if 0
 static char sccsid[] = @(#)cu.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: cu.c,v 1.21 2011/09/06 18:33:01 joerg Exp $);
+__RCSID($NetBSD: cu.c,v 1.22 2014/07/27 04:32:23 dholland Exp $);
 #endif /* not lint */
 
 #include tip.h
@@ -55,7 +55,8 @@ cumain(int argc, char *argv[])
 	int flow = -1;		/* -1 is tandem ^S/^Q */
 	static int helpme = 0, nostop = 0;
 	char useresc = '~';
-	static char sbuf[12], brbuf[16];
+	static char sbuf[12];
+	int cmdlineBR;
 	extern char *optarg;
 	extern int optind;
 
@@ -80,6 +81,7 @@ cumain(int argc, char *argv[])
 	CU = NULL;
 	DV = NULL;
 	BR = DEFBR;
+	cmdlineBR = 0;
 
 	while((c = getopt_long(argc, argv,
 	E:F:P:a:p:c:l:s:hefot0123456789, longopts, NULL)) != -1) {
@@ -159,9 +161,8 @@ cumain(int argc, char *argv[])
 			break;
 		case '0': case '1': case '2': case '3': case '4':
 		case '5': case '6': case '7': case '8': case '9':
-			(void)snprintf(brbuf, sizeof(brbuf) -1, %s%c,
- brbuf, c);
-			BR = atoi(brbuf);
+			cmdlineBR = cmdlineBR * 10 + (c - '0');
+			BR = cmdlineBR;
 			break;
 		default:
 			if (nostop == 0)

Index: src/usr.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.54 src/usr.bin/tip/tip.c:1.55
--- src/usr.bin/tip/tip.c:1.54	Sat Jul 12 05:28:07 2014
+++ src/usr.bin/tip/tip.c	Sun Jul 27 04:32:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.54 2014/07/12 05:28:07 mlelstv Exp $	*/
+/*	$NetBSD: tip.c,v 1.55 2014/07/27 04:32:23 dholland Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)tip.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: tip.c,v 1.54 2014/07/12 05:28:07 mlelstv Exp $);
+__RCSID($NetBSD: tip.c,v 1.55 2014/07/27 04:32:23 dholland Exp $);
 #endif /* not lint */
 
 /*
@@ -73,7 +73,7 @@ main(int argc, char *argv[])
 	char *p;
 	const char *q;
 	char sbuf[12];
-	static char brbuf[16];
+	int cmdlineBR;
 	int fcarg;
 
 	setprogname(argv[0]);
@@ -95,6 +95,7 @@ main(int argc, char *argv[])
 		exit(1);
 	}
 
+	cmdlineBR = 0;
 	while((c = getopt(argc, argv, v0123456789)) != -1) {
 		switch(c) {
 
@@ -104,8 +105,8 @@ main(int argc, char *argv[])
 
 		case '0': case '1': case '2': case '3': case '4':
 		case '5': case '6': case '7': case '8': case '9':
-			(void)snprintf(brbuf, sizeof(brbuf) -1, %s%c, brbuf, c);
-			BR = atoi(brbuf);
+			cmdlineBR = cmdlineBR * 10 + (c - '0');
+			BR = cmdlineBR;
 			break;
 
 		default:



CVS commit: src/usr.bin/tip

2014-07-11 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jul 12 05:28:07 UTC 2014

Modified Files:
src/usr.bin/tip: cmds.c tip.c

Log Message:
don't enable IXANY.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.bin/tip/cmds.c
cvs rdiff -u -r1.53 -r1.54 src/usr.bin/tip/tip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/cmds.c
diff -u src/usr.bin/tip/cmds.c:1.36 src/usr.bin/tip/cmds.c:1.37
--- src/usr.bin/tip/cmds.c:1.36	Sun Jun  2 13:18:12 2013
+++ src/usr.bin/tip/cmds.c	Sat Jul 12 05:28:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmds.c,v 1.36 2013/06/02 13:18:12 christos Exp $	*/
+/*	$NetBSD: cmds.c,v 1.37 2014/07/12 05:28:07 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)cmds.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: cmds.c,v 1.36 2013/06/02 13:18:12 christos Exp $);
+__RCSID($NetBSD: cmds.c,v 1.37 2014/07/12 05:28:07 mlelstv Exp $);
 #endif /* not lint */
 
 #include tip.h
@@ -792,11 +792,11 @@ tandem(const char *option)
 
 	(void)tcgetattr(FD, rmtty);
 	if (strcmp(option, on) == 0) {
-		rmtty.c_iflag |= IXON|IXOFF|IXANY;
-		term.c_iflag |= IXON|IXOFF|IXANY;
+		rmtty.c_iflag |= IXON|IXOFF;
+		term.c_iflag |= IXON|IXOFF;
 	} else {
-		rmtty.c_iflag = ~(IXON|IXOFF|IXANY);
-		term.c_iflag = ~(IXON|IXOFF|IXANY);
+		rmtty.c_iflag = ~(IXON|IXOFF);
+		term.c_iflag = ~(IXON|IXOFF);
 	}
 	(void)tcsetattr(FD, TCSADRAIN, rmtty);
 	(void)tcsetattr(0, TCSADRAIN, term);

Index: src/usr.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.53 src/usr.bin/tip/tip.c:1.54
--- src/usr.bin/tip/tip.c:1.53	Mon Oct 21 14:47:46 2013
+++ src/usr.bin/tip/tip.c	Sat Jul 12 05:28:07 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.53 2013/10/21 14:47:46 christos Exp $	*/
+/*	$NetBSD: tip.c,v 1.54 2014/07/12 05:28:07 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)tip.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: tip.c,v 1.53 2013/10/21 14:47:46 christos Exp $);
+__RCSID($NetBSD: tip.c,v 1.54 2014/07/12 05:28:07 mlelstv Exp $);
 #endif /* not lint */
 
 /*
@@ -497,9 +497,9 @@ ttysetup(speed_t spd)
 	cntrl.c_cc[VMIN] = 1;
 	cntrl.c_cc[VTIME] = 0;
 	if (boolean(value(TAND)))
-		cntrl.c_iflag |= IXOFF|IXON|IXANY;
+		cntrl.c_iflag |= IXOFF|IXON;
 	else
-		cntrl.c_iflag = ~(IXOFF|IXON|IXANY);
+		cntrl.c_iflag = ~(IXOFF|IXON);
 	return tcsetattr(FD, TCSAFLUSH, cntrl);
 }
 



CVS commit: src/usr.bin/tip

2013-10-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 21 14:47:46 UTC 2013

Modified Files:
src/usr.bin/tip: remote.c tip.c tip.h value.c

Log Message:
get rid of equal(), use {s,g}etprogname().


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/tip/remote.c
cvs rdiff -u -r1.52 -r1.53 src/usr.bin/tip/tip.c
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/tip/tip.h
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/tip/value.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/remote.c
diff -u src/usr.bin/tip/remote.c:1.18 src/usr.bin/tip/remote.c:1.19
--- src/usr.bin/tip/remote.c:1.18	Mon Jul 21 10:19:26 2008
+++ src/usr.bin/tip/remote.c	Mon Oct 21 10:47:46 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: remote.c,v 1.18 2008/07/21 14:19:26 lukem Exp $	*/
+/*	$NetBSD: remote.c,v 1.19 2013/10/21 14:47:46 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1992, 19
 #if 0
 static char sccsid[] = @(#)remote.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: remote.c,v 1.18 2008/07/21 14:19:26 lukem Exp $);
+__RCSID($NetBSD: remote.c,v 1.19 2013/10/21 14:47:46 christos Exp $);
 #endif /* not lint */
 
 #include pathnames.h
@@ -143,7 +143,7 @@ getremcap(char *host)
 	 *   from the description file
 	 */
 	if (!HW)
-		HW = (CU == NULL) || (DU  equal(DV, CU));
+		HW = (CU == NULL) || (DU  strcmp(DV, CU) == 0);
 	HO = host;
 	/*
 	 * see if uppercase mode should be turned on initially

Index: src/usr.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.52 src/usr.bin/tip/tip.c:1.53
--- src/usr.bin/tip/tip.c:1.52	Sun Jun  2 09:18:12 2013
+++ src/usr.bin/tip/tip.c	Mon Oct 21 10:47:46 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.52 2013/06/02 13:18:12 christos Exp $	*/
+/*	$NetBSD: tip.c,v 1.53 2013/10/21 14:47:46 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)tip.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: tip.c,v 1.52 2013/06/02 13:18:12 christos Exp $);
+__RCSID($NetBSD: tip.c,v 1.53 2013/10/21 14:47:46 christos Exp $);
 #endif /* not lint */
 
 /*
@@ -76,11 +76,12 @@ main(int argc, char *argv[])
 	static char brbuf[16];
 	int fcarg;
 
+	setprogname(argv[0]);
 	gid = getgid();
 	egid = getegid();
 	uid = getuid();
 	euid = geteuid();
-	if (equal(basename(argv[0]), cu)) {
+	if (strcmp(getprogname(), cu) == 0) {
 		cumode = 1;
 		cumain(argc, argv);
 		goto cucommon;
@@ -545,7 +546,7 @@ setparity(const char *defparity)
 		value(PARITY) = curpar = strdup(defparity);
 	}
 	parity = value(PARITY);
-	if (equal(parity, none)) {
+	if (strcmp(parity, none) == 0) {
 		bits8 = 1;
 		return;
 	}
@@ -553,13 +554,13 @@ setparity(const char *defparity)
 	flip = 0;
 	clr = 0377;
 	set = 0;
-	if (equal(parity, odd))
+	if (strcmp(parity, odd) == 0)
 		flip = 0200;			/* reverse bit 7 */
-	else if (equal(parity, zero))
+	else if (strcmp(parity, zero) == 0)
 		clr = 0177;			/* turn off bit 7 */
-	else if (equal(parity, one))
+	else if (strcmp(parity, one) == 0)
 		set = 0200;			/* turn on bit 7 */
-	else if (!equal(parity, even)) {
+	else if (strcmp(parity, even) != 0) {
 		(void)fprintf(stderr, %s: unknown parity value\r\n, parity);
 		(void)fflush(stderr);
 	}

Index: src/usr.bin/tip/tip.h
diff -u src/usr.bin/tip/tip.h:1.32 src/usr.bin/tip/tip.h:1.33
--- src/usr.bin/tip/tip.h:1.32	Tue Sep  6 14:33:01 2011
+++ src/usr.bin/tip/tip.h	Mon Oct 21 10:47:46 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.h,v 1.32 2011/09/06 18:33:01 joerg Exp $	*/
+/*	$NetBSD: tip.h,v 1.33 2013/10/21 14:47:46 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -141,8 +141,6 @@ typedef
 	}
 	acu_t;
 
-#define	equal(a, b)	(strcmp(a,b)==0)/* A nice function to string compare */
-
 /*
  * variable manipulation stuff --
  *   if we defined the value entry in value_t, then we couldn't

Index: src/usr.bin/tip/value.c
diff -u src/usr.bin/tip/value.c:1.14 src/usr.bin/tip/value.c:1.15
--- src/usr.bin/tip/value.c:1.14	Thu Dec 14 12:09:43 2006
+++ src/usr.bin/tip/value.c	Mon Oct 21 10:47:46 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: value.c,v 1.14 2006/12/14 17:09:43 christos Exp $	*/
+/*	$NetBSD: value.c,v 1.15 2013/10/21 14:47:46 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)value.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: value.c,v 1.14 2006/12/14 17:09:43 christos Exp $);
+__RCSID($NetBSD: value.c,v 1.15 2013/10/21 14:47:46 christos Exp $);
 #endif /* not lint */
 
 #include tip.h
@@ -101,7 +101,7 @@ vassign(value_t *p, char *v)
 	switch (p-v_typeTMASK) {
 
 	case STRING:
-		if (p-v_value  equal(p-v_value, v))
+		if (p-v_value  strcmp(p-v_value, v) == 0)
 			return;
 		if (!(p-v_type(ENVIRON|INIT)))
 			free(p-v_value);
@@ -137,7 +137,7 @@ vlex(char *s)
 {
 	value_t *p;
 
-	if (equal(s, all)) {
+	if (strcmp(s, all) == 0) {
 		for (p = vtable; p-v_name; 

CVS commit: src/usr.bin/tip

2013-06-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun  2 13:18:12 UTC 2013

Modified Files:
src/usr.bin/tip: cmds.c tip.c

Log Message:
PR/47877: Michael van Elst: Disable and enable software flow control properly


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/tip/cmds.c
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/tip/tip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/cmds.c
diff -u src/usr.bin/tip/cmds.c:1.35 src/usr.bin/tip/cmds.c:1.36
--- src/usr.bin/tip/cmds.c:1.35	Fri Feb 24 11:03:39 2012
+++ src/usr.bin/tip/cmds.c	Sun Jun  2 09:18:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmds.c,v 1.35 2012/02/24 16:03:39 joerg Exp $	*/
+/*	$NetBSD: cmds.c,v 1.36 2013/06/02 13:18:12 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)cmds.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: cmds.c,v 1.35 2012/02/24 16:03:39 joerg Exp $);
+__RCSID($NetBSD: cmds.c,v 1.36 2013/06/02 13:18:12 christos Exp $);
 #endif /* not lint */
 
 #include tip.h
@@ -792,11 +792,11 @@ tandem(const char *option)
 
 	(void)tcgetattr(FD, rmtty);
 	if (strcmp(option, on) == 0) {
-		rmtty.c_iflag |= IXOFF;
-		term.c_iflag |= IXOFF;
+		rmtty.c_iflag |= IXON|IXOFF|IXANY;
+		term.c_iflag |= IXON|IXOFF|IXANY;
 	} else {
-		rmtty.c_iflag = ~IXOFF;
-		term.c_iflag = ~IXOFF;
+		rmtty.c_iflag = ~(IXON|IXOFF|IXANY);
+		term.c_iflag = ~(IXON|IXOFF|IXANY);
 	}
 	(void)tcsetattr(FD, TCSADRAIN, rmtty);
 	(void)tcsetattr(0, TCSADRAIN, term);

Index: src/usr.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.51 src/usr.bin/tip/tip.c:1.52
--- src/usr.bin/tip/tip.c:1.51	Tue Sep  6 14:33:01 2011
+++ src/usr.bin/tip/tip.c	Sun Jun  2 09:18:12 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.51 2011/09/06 18:33:01 joerg Exp $	*/
+/*	$NetBSD: tip.c,v 1.52 2013/06/02 13:18:12 christos Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)tip.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: tip.c,v 1.51 2011/09/06 18:33:01 joerg Exp $);
+__RCSID($NetBSD: tip.c,v 1.52 2013/06/02 13:18:12 christos Exp $);
 #endif /* not lint */
 
 /*
@@ -496,7 +496,9 @@ ttysetup(speed_t spd)
 	cntrl.c_cc[VMIN] = 1;
 	cntrl.c_cc[VTIME] = 0;
 	if (boolean(value(TAND)))
-		cntrl.c_iflag |= IXOFF;
+		cntrl.c_iflag |= IXOFF|IXON|IXANY;
+	else
+		cntrl.c_iflag = ~(IXOFF|IXON|IXANY);
 	return tcsetattr(FD, TCSAFLUSH, cntrl);
 }
 



CVS commit: src/usr.bin/tip

2012-02-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Feb 24 16:03:39 UTC 2012

Modified Files:
src/usr.bin/tip: cmds.c

Log Message:
Add explicit continue to empty loop body.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/usr.bin/tip/cmds.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/cmds.c
diff -u src/usr.bin/tip/cmds.c:1.34 src/usr.bin/tip/cmds.c:1.35
--- src/usr.bin/tip/cmds.c:1.34	Thu Feb 23 23:39:19 2012
+++ src/usr.bin/tip/cmds.c	Fri Feb 24 16:03:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmds.c,v 1.34 2012/02/23 23:39:19 joerg Exp $	*/
+/*	$NetBSD: cmds.c,v 1.35 2012/02/24 16:03:39 joerg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)cmds.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: cmds.c,v 1.34 2012/02/23 23:39:19 joerg Exp $);
+__RCSID($NetBSD: cmds.c,v 1.35 2012/02/24 16:03:39 joerg Exp $);
 #endif /* not lint */
 
 #include tip.h
@@ -888,7 +888,7 @@ expand(char aname[])
 	l = read(pivec[0], xname, BUFSIZ);
 	(void)close(pivec[0]);
 	while (wait(s) != mypid)
-		;
+		continue;
 	s = 0377;
 	if (s != 0  s != SIGPIPE) {
 		(void)fprintf(stderr, \Echo\ failed\n);



CVS commit: src/usr.bin/tip

2012-02-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Thu Feb 23 23:39:19 UTC 2012

Modified Files:
src/usr.bin/tip: cmds.c

Log Message:
while (...);
;
is really pointless, so remove the first semicolon.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/tip/cmds.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/cmds.c
diff -u src/usr.bin/tip/cmds.c:1.33 src/usr.bin/tip/cmds.c:1.34
--- src/usr.bin/tip/cmds.c:1.33	Tue Sep  6 18:33:01 2011
+++ src/usr.bin/tip/cmds.c	Thu Feb 23 23:39:19 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmds.c,v 1.33 2011/09/06 18:33:01 joerg Exp $	*/
+/*	$NetBSD: cmds.c,v 1.34 2012/02/23 23:39:19 joerg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)cmds.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: cmds.c,v 1.33 2011/09/06 18:33:01 joerg Exp $);
+__RCSID($NetBSD: cmds.c,v 1.34 2012/02/23 23:39:19 joerg Exp $);
 #endif /* not lint */
 
 #include tip.h
@@ -887,7 +887,7 @@ expand(char aname[])
 	(void)close(pivec[1]);
 	l = read(pivec[0], xname, BUFSIZ);
 	(void)close(pivec[0]);
-	while (wait(s) != mypid);
+	while (wait(s) != mypid)
 		;
 	s = 0377;
 	if (s != 0  s != SIGPIPE) {



CVS commit: src/usr.bin/tip

2011-09-06 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Sep  6 18:33:01 UTC 2011

Modified Files:
src/usr.bin/tip: acu.c cmds.c cu.c hunt.c tip.c tip.h tipout.c
src/usr.bin/tip/aculib: hayes.c

Log Message:
Use __dead. Make a bunch of local functions static.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/tip/acu.c
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/tip/cmds.c
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/tip/cu.c
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/tip/hunt.c
cvs rdiff -u -r1.50 -r1.51 src/usr.bin/tip/tip.c
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/tip/tip.h
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/tip/tipout.c
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/tip/aculib/hayes.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/acu.c
diff -u src/usr.bin/tip/acu.c:1.15 src/usr.bin/tip/acu.c:1.16
--- src/usr.bin/tip/acu.c:1.15	Thu Dec 14 17:09:43 2006
+++ src/usr.bin/tip/acu.c	Tue Sep  6 18:33:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: acu.c,v 1.15 2006/12/14 17:09:43 christos Exp $	*/
+/*	$NetBSD: acu.c,v 1.16 2011/09/06 18:33:01 joerg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)acu.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: acu.c,v 1.15 2006/12/14 17:09:43 christos Exp $);
+__RCSID($NetBSD: acu.c,v 1.16 2011/09/06 18:33:01 joerg Exp $);
 #endif /* not lint */
 
 #include tip.h
@@ -43,7 +43,7 @@
 static int conflag;
 static jmp_buf jmpbuf;
 
-static void	acuabort(int);
+__dead static void	acuabort(int);
 static acu_t   *acutype(char *);
 
 /*

Index: src/usr.bin/tip/cmds.c
diff -u src/usr.bin/tip/cmds.c:1.32 src/usr.bin/tip/cmds.c:1.33
--- src/usr.bin/tip/cmds.c:1.32	Thu Dec 14 17:09:43 2006
+++ src/usr.bin/tip/cmds.c	Tue Sep  6 18:33:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmds.c,v 1.32 2006/12/14 17:09:43 christos Exp $	*/
+/*	$NetBSD: cmds.c,v 1.33 2011/09/06 18:33:01 joerg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)cmds.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: cmds.c,v 1.32 2006/12/14 17:09:43 christos Exp $);
+__RCSID($NetBSD: cmds.c,v 1.33 2011/09/06 18:33:01 joerg Exp $);
 #endif /* not lint */
 
 #include tip.h
@@ -55,7 +55,7 @@
 int	args(char *, char **);
 int	anyof(char *, const char *);
 void	execute(char *);
-void	intcopy(int);
+__dead static void	intcopy(int);
 void	prtime(const char *, time_t);
 void	stopsnd(int);
 void	transfer(char *, int, const char *);

Index: src/usr.bin/tip/cu.c
diff -u src/usr.bin/tip/cu.c:1.20 src/usr.bin/tip/cu.c:1.21
--- src/usr.bin/tip/cu.c:1.20	Thu Dec 14 17:09:43 2006
+++ src/usr.bin/tip/cu.c	Tue Sep  6 18:33:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cu.c,v 1.20 2006/12/14 17:09:43 christos Exp $	*/
+/*	$NetBSD: cu.c,v 1.21 2011/09/06 18:33:01 joerg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -36,13 +36,13 @@
 #if 0
 static char sccsid[] = @(#)cu.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: cu.c,v 1.20 2006/12/14 17:09:43 christos Exp $);
+__RCSID($NetBSD: cu.c,v 1.21 2011/09/06 18:33:01 joerg Exp $);
 #endif /* not lint */
 
 #include tip.h
 
-static void cuhelp(void);
-static void cuusage(void);
+__dead static void cuhelp(void);
+__dead static void cuusage(void);
 
 /*
  * Botch the interface to look like cu's

Index: src/usr.bin/tip/hunt.c
diff -u src/usr.bin/tip/hunt.c:1.17 src/usr.bin/tip/hunt.c:1.18
--- src/usr.bin/tip/hunt.c:1.17	Tue May 24 12:46:16 2011
+++ src/usr.bin/tip/hunt.c	Tue Sep  6 18:33:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hunt.c,v 1.17 2011/05/24 12:46:16 joerg Exp $	*/
+/*	$NetBSD: hunt.c,v 1.18 2011/09/06 18:33:01 joerg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)hunt.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: hunt.c,v 1.17 2011/05/24 12:46:16 joerg Exp $);
+__RCSID($NetBSD: hunt.c,v 1.18 2011/09/06 18:33:01 joerg Exp $);
 #endif /* not lint */
 
 #include tip.h
@@ -42,9 +42,9 @@
 static	jmp_buf deadline;
 static	int deadfl;
 
-void	dead(int);
+__dead static void	dead(int);
 
-void
+static void
 /*ARGSUSED*/
 dead(int dummy __unused)
 {

Index: src/usr.bin/tip/tip.c
diff -u src/usr.bin/tip/tip.c:1.50 src/usr.bin/tip/tip.c:1.51
--- src/usr.bin/tip/tip.c:1.50	Sun Jan 18 07:12:39 2009
+++ src/usr.bin/tip/tip.c	Tue Sep  6 18:33:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tip.c,v 1.50 2009/01/18 07:12:39 lukem Exp $	*/
+/*	$NetBSD: tip.c,v 1.51 2011/09/06 18:33:01 joerg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = @(#)tip.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: tip.c,v 1.50 2009/01/18 07:12:39 lukem Exp $);
+__RCSID($NetBSD: tip.c,v 1.51 2011/09/06 18:33:01 joerg Exp $);
 #endif /* not lint */
 
 /*
@@ -54,12 +54,12 @@
 #include tip.h
 #include pathnames.h
 
-static void	tipusage(void);
+__dead static void	tipusage(void);
 
 int	escape(void);
 int	main(int, char **);
-void	

CVS commit: src/usr.bin/tip

2011-05-24 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue May 24 12:46:16 UTC 2011

Modified Files:
src/usr.bin/tip: hunt.c

Log Message:
Properly use format string


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/tip/hunt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/tip/hunt.c
diff -u src/usr.bin/tip/hunt.c:1.16 src/usr.bin/tip/hunt.c:1.17
--- src/usr.bin/tip/hunt.c:1.16	Thu Dec 14 17:09:43 2006
+++ src/usr.bin/tip/hunt.c	Tue May 24 12:46:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hunt.c,v 1.16 2006/12/14 17:09:43 christos Exp $	*/
+/*	$NetBSD: hunt.c,v 1.17 2011/05/24 12:46:16 joerg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)hunt.c	8.1 (Berkeley) 6/6/93;
 #endif
-__RCSID($NetBSD: hunt.c,v 1.16 2006/12/14 17:09:43 christos Exp $);
+__RCSID($NetBSD: hunt.c,v 1.17 2011/05/24 12:46:16 joerg Exp $);
 #endif /* not lint */
 
 #include tip.h
@@ -76,7 +76,7 @@
 		}
 		(void)alarm(0);
 		if (FD  0) {
-			warn(cp);
+			warn(%s, cp);
 			deadfl = 1;
 		} else if (!deadfl) {
 			struct termios cntrl;