Subject: bin/6036: egcs-reveales brace fixes for usr.bin
To: None <netbsd-bugs@netbsd.org>
From: Erik Bertelsen <erik@q610.ebe.uni-c.dk>
List: netbsd-bugs
Date: 08/25/1998 07:06:43
>Number:         6036
>Category:       bin
>Synopsis:       egcs-reveales brace fixes for usr.bin
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 24 22:20:01 1998
>Last-Modified:
>Originator:     Erik Bertelsen
>Organization:
	
>Release:        NetBSD-current 23 Aug 1998
>Environment:
	
System: NetBSD q610.ebe.uni-c.dk 1.3G NetBSD 1.3G (Q610) #184: Sun Aug 23 23:59:05 MEST 1998 erik@q610.ebe.uni-c.dk:/home/src/sys/arch/mac68k/compile/Q610 mac68k


>Description:
	Here are my fixes to brace related warnings issued by egcs 1.1
	for source files below /usr/src/usr.bin.
	The following files are affected:
Index: cmp/regular.c
Index: cmp/special.c
Index: ctags/ctags.c
Index: cut/cut.c
Index: finger/finger.c
Index: hexdump/odsyntax.c
Index: id/id.c
Index: indent/indent.c
Index: indent/io.c
Index: indent/lexi.c
Index: join/join.c
Index: last/last.c
Index: login/login.c
Index: mail/send.c
Index: man/man.c
Index: netstat/if.c
Index: netstat/inet.c
Index: quota/quota.c
Index: rdist/expand.c
Index: rpcgen/rpc_cout.c
Index: sed/process.c
Index: su/su.c
Index: systat/netstat.c
Index: tail/tail.c
Index: tcopy/tcopy.c
Index: tip/cmds.c
Index: tip/log.c
Index: tip/remote.c
Index: touch/touch.c
Index: tset/term.c
Index: tsort/tsort.c
Index: window/cmd.c
Index: window/lcmd2.c
Index: window/parser2.c
Index: window/scanner.c
Index: window/ttgeneric.c
Index: window/win.c
Index: window/wwopen.c
Index: write/write.c
Index: yacc/mkpar.c

	As some of the ``holy'' programs (login, su) are involved,
	a double-check of the patches might be in place, although
	I tried to be careful while making the changes :-)

	regards
	Erik Bertelsen
>How-To-Repeat:
>Fix:
Index: cmp/regular.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/cmp/regular.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 regular.c
*** regular.c	1998/01/14 18:25:27	1.1.1.4
--- regular.c	1998/08/24 20:36:41
***************
*** 87,93 ****
  
  	dfound = 0;
  	for (byte = line = 1; length--; ++p1, ++p2, ++byte) {
! 		if ((ch = *p1) != *p2)
  			if (lflag) {
  				dfound = 1;
  				(void)printf("%6qd %3o %3o\n", (long long)byte,
--- 87,93 ----
  
  	dfound = 0;
  	for (byte = line = 1; length--; ++p1, ++p2, ++byte) {
! 		if ((ch = *p1) != *p2) {
  			if (lflag) {
  				dfound = 1;
  				(void)printf("%6qd %3o %3o\n", (long long)byte,
***************
*** 95,100 ****
--- 95,101 ----
  			} else
  				diffmsg(file1, file2, byte, line);
  				/* NOTREACHED */
+ 		}
  		if (ch == '\n')
  			++line;
  	}
Index: cmp/special.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/cmp/special.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 special.c
*** special.c	1997/10/19 16:53:19	1.1.1.3
--- special.c	1998/08/24 20:38:08
***************
*** 81,87 ****
  		ch2 = getc(fp2);
  		if (ch1 == EOF || ch2 == EOF)
  			break;
! 		if (ch1 != ch2)
  			if (lflag) {
  				dfound = 1;
  				(void)printf("%6qd %3o %3o\n", (long long)byte,
--- 81,87 ----
  		ch2 = getc(fp2);
  		if (ch1 == EOF || ch2 == EOF)
  			break;
! 		if (ch1 != ch2) {
  			if (lflag) {
  				dfound = 1;
  				(void)printf("%6qd %3o %3o\n", (long long)byte,
***************
*** 89,94 ****
--- 89,95 ----
  			} else
  				diffmsg(file1, file2, byte, line);
  				/* NOTREACHED */
+ 		}
  		if (ch1 == '\n')
  			++line;
  	}
Index: ctags/ctags.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/ctags/ctags.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 ctags.c
*** ctags.c	1997/10/19 17:05:10	1.1.1.2
--- ctags.c	1998/08/24 18:26:09
***************
*** 154,160 ****
  			(void)fclose(inf);
  		}
  
! 	if (head)
  		if (xflag)
  			put_entries(head);
  		else {
--- 154,160 ----
  			(void)fclose(inf);
  		}
  
! 	if (head) {
  		if (xflag)
  			put_entries(head);
  		else {
***************
*** 178,183 ****
--- 178,184 ----
  				system(cmd);
  			}
  		}
+ 	}
  	exit(exit_val);
  }
  
Index: cut/cut.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/cut/cut.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 cut.c
*** cut.c	1997/10/19 17:05:26	1.1.1.3
--- cut.c	1998/08/24 20:43:04
***************
*** 215,226 ****
  			if (*pos++)
  				(void)putchar(ch);
  		}
! 		if (ch != '\n')
  			if (autostop)
  				while ((ch = getc(fp)) != EOF && ch != '\n')
  					(void)putchar(ch);
  			else
  				while ((ch = getc(fp)) != EOF && ch != '\n');
  		(void)putchar('\n');
  	}
  }
--- 215,227 ----
  			if (*pos++)
  				(void)putchar(ch);
  		}
! 		if (ch != '\n') {
  			if (autostop)
  				while ((ch = getc(fp)) != EOF && ch != '\n')
  					(void)putchar(ch);
  			else
  				while ((ch = getc(fp)) != EOF && ch != '\n');
+ 		}
  		(void)putchar('\n');
  	}
  }
***************
*** 264,270 ****
  			if (ch == '\n')
  				break;
  		}
! 		if (ch != '\n')
  			if (autostop) {
  				if (output)
  					(void)putchar(sep);
--- 265,271 ----
  			if (ch == '\n')
  				break;
  		}
! 		if (ch != '\n') {
  			if (autostop) {
  				if (output)
  					(void)putchar(sep);
***************
*** 272,277 ****
--- 273,279 ----
  					(void)putchar(ch);
  			} else
  				for (; (ch = *p) != '\n'; ++p);
+ 		}
  		(void)putchar('\n');
  	}
  }
Index: finger/finger.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/finger/finger.c,v
retrieving revision 1.1.1.6
diff -c -r1.1.1.6 finger.c
*** finger.c	1998/08/11 13:37:05	1.1.1.6
--- finger.c	1998/08/24 20:52:03
***************
*** 164,174 ****
  		if (!sflag)
  			lflag = 1;	/* if -s not explicit, force -l */
  	}
! 	if (entries)
  		if (lflag)
  			lflag_print();
  		else
  			sflag_print();
  	return (0);
  }
  
--- 164,175 ----
  		if (!sflag)
  			lflag = 1;	/* if -s not explicit, force -l */
  	}
! 	if (entries) {
  		if (lflag)
  			lflag_print();
  		else
  			sflag_print();
+ 	}
  	return (0);
  }
  
Index: hexdump/odsyntax.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/hexdump/odsyntax.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 odsyntax.c
*** odsyntax.c	1997/10/19 16:55:18	1.1.1.4
--- odsyntax.c	1998/08/24 20:53:08
***************
*** 226,232 ****
  		return;
  	}
  
! 	if (*p)
  		if (*p == 'B') {
  			skip *= 1024;
  			++p;
--- 226,232 ----
  		return;
  	}
  
! 	if (*p) {
  		if (*p == 'B') {
  			skip *= 1024;
  			++p;
***************
*** 234,239 ****
--- 234,240 ----
  			skip *= 512;
  			++p;
  		}
+ 	}
  
  	if (*p) {
  		skip = 0;
Index: id/id.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/id/id.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 id.c
*** id.c	1997/10/19 16:55:32	1.1.1.2
--- id.c	1998/08/24 20:53:49
***************
*** 174,189 ****
  		else
  			(void)printf("uid\t%u\n", rid);
  		
! 		if ((eid = geteuid()) != rid)
  			if ((pw = getpwuid(eid)) != NULL)
  				(void)printf("euid\t%s", pw->pw_name);
  			else
  				(void)printf("euid\t%u", eid);
! 		if ((rid = getgid()) != (eid = getegid()))
  			if ((gr = getgrgid(rid)) != NULL)
  				(void)printf("rgid\t%s\n", gr->gr_name);
  			else
  				(void)printf("rgid\t%u\n", rid);
  		(void)printf("groups\t");
  		group(NULL, 1);
  	}
--- 174,191 ----
  		else
  			(void)printf("uid\t%u\n", rid);
  		
! 		if ((eid = geteuid()) != rid) {
  			if ((pw = getpwuid(eid)) != NULL)
  				(void)printf("euid\t%s", pw->pw_name);
  			else
  				(void)printf("euid\t%u", eid);
! 		}
! 		if ((rid = getgid()) != (eid = getegid())) {
  			if ((gr = getgrgid(rid)) != NULL)
  				(void)printf("rgid\t%s\n", gr->gr_name);
  			else
  				(void)printf("rgid\t%u\n", rid);
+ 		}
  		(void)printf("groups\t");
  		group(NULL, 1);
  	}
Index: indent/indent.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/indent/indent.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 indent.c
*** indent.c	1997/10/19 16:55:41	1.1.1.3
--- indent.c	1998/08/24 20:57:38
***************
*** 223,235 ****
  		fprintf(stderr, "indent: usage: indent file [ outfile ] [ options ]\n");
  		exit(1);
  	}
! 	if (output == 0)
  		if (troff)
  			output = stdout;
  		else {
  			out_name = in_name;
  			bakcopy();
  		}
  	if (ps.com_ind <= 1)
  		ps.com_ind = 2;	/* dont put normal comments before column 2 */
  	if (troff) {
--- 223,236 ----
  		fprintf(stderr, "indent: usage: indent file [ outfile ] [ options ]\n");
  		exit(1);
  	}
! 	if (output == 0) {
  		if (troff)
  			output = stdout;
  		else {
  			out_name = in_name;
  			bakcopy();
  		}
+ 	}
  	if (ps.com_ind <= 1)
  		ps.com_ind = 2;	/* dont put normal comments before column 2 */
  	if (troff) {
***************
*** 977,983 ****
  					*e_code++ = ' ';
  				ps.want_blank = false;
  				if (is_procname == 0 || !procnames_start_line) {
! 					if (!ps.block_init)
  						if (troff && !ps.dumped_decl_indent) {
  							sprintf(e_code, "\n.De %dp+\200p\n", dec_ind * 7);
  							ps.dumped_decl_indent = 1;
--- 978,984 ----
  					*e_code++ = ' ';
  				ps.want_blank = false;
  				if (is_procname == 0 || !procnames_start_line) {
! 					if (!ps.block_init) {
  						if (troff && !ps.dumped_decl_indent) {
  							sprintf(e_code, "\n.De %dp+\200p\n", dec_ind * 7);
  							ps.dumped_decl_indent = 1;
***************
*** 987,992 ****
--- 988,994 ----
  								CHECK_SIZE_CODE;
  								*e_code++ = ' ';
  							}
+ 					}
  				} else {
  					if (dec_ind && s_code != e_code)
  						dump_line();
Index: indent/io.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/indent/io.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 io.c
*** io.c	1998/03/31 15:11:10	1.1.1.4
--- io.c	1998/08/24 21:05:12
***************
*** 89,95 ****
  		if (!inhibit_formatting) {
  			suppress_blanklines = 0;
  			ps.bl_line = false;
! 			if (prefix_blankline_requested && not_first_line)
  				if (swallow_optional_blanklines) {
  					if (n_real_blanklines == 1)
  						n_real_blanklines = 0;
--- 89,95 ----
  		if (!inhibit_formatting) {
  			suppress_blanklines = 0;
  			ps.bl_line = false;
! 			if (prefix_blankline_requested && not_first_line) {
  				if (swallow_optional_blanklines) {
  					if (n_real_blanklines == 1)
  						n_real_blanklines = 0;
***************
*** 97,102 ****
--- 97,103 ----
  					if (n_real_blanklines == 0)
  						n_real_blanklines = 1;
  				}
+ 			}
  			while (--n_real_blanklines >= 0)
  				putc('\n', output);
  			n_real_blanklines = 0;
***************
*** 164,170 ****
  						putc(*p, output);
  				cur_col = count_spaces(cur_col, s_code);
  			}
! 			if (s_com != e_com)
  				if (troff) {
  					int     all_here = 0;
  					char   *p;
--- 165,171 ----
  						putc(*p, output);
  				cur_col = count_spaces(cur_col, s_code);
  			}
! 			if (s_com != e_com) {
  				if (troff) {
  					int     all_here = 0;
  					char   *p;
***************
*** 248,258 ****
  						e_com--;
  					cur_col = pad_output(cur_col, target);
  					if (!ps.box_com) {
! 						if (star_comment_cont && (com_st[1] != '*' || e_com <= com_st + 1))
  							if (com_st[1] == ' ' && com_st[0] == ' ' && e_com > com_st + 1)
  								com_st[1] = '*';
  							else
  								fwrite(" * ", com_st[0] == '\t' ? 2 : com_st[0] == '*' ? 1 : 3, 1, output);
  					}
  					fwrite(com_st, e_com - com_st, 1, output);
  					ps.comment_delta = ps.n_comment_delta;
--- 249,260 ----
  						e_com--;
  					cur_col = pad_output(cur_col, target);
  					if (!ps.box_com) {
! 						if (star_comment_cont && (com_st[1] != '*' || e_com <= com_st + 1)) {
  							if (com_st[1] == ' ' && com_st[0] == ' ' && e_com > com_st + 1)
  								com_st[1] = '*';
  							else
  								fwrite(" * ", com_st[0] == '\t' ? 2 : com_st[0] == '*' ? 1 : 3, 1, output);
+ 						}
  					}
  					fwrite(com_st, e_com - com_st, 1, output);
  					ps.comment_delta = ps.n_comment_delta;
***************
*** 260,265 ****
--- 262,268 ----
  					++ps.com_lines;	/* count lines with
  							 * comments */
  				}
+ 			}
  			if (ps.use_ff)
  				putc('\014', output);
  			else
***************
*** 402,413 ****
  					if (*p == '*')
  						com = 1;
  					else
! 						if (*p == 'O')
  							if (*++p == 'N')
  								p++, com = 1;
  							else
  								if (*p == 'F' && *++p == 'F')
  									p++, com = 2;
  					while (*p == ' ' || *p == '\t')
  						p++;
  					if (p[0] == '*' && p[1] == '/' && p[2] == '\n' && com) {
--- 405,417 ----
  					if (*p == '*')
  						com = 1;
  					else
! 						if (*p == 'O') {
  							if (*++p == 'N')
  								p++, com = 1;
  							else
  								if (*p == 'F' && *++p == 'F')
  									p++, com = 2;
+ 						}
  					while (*p == ' ' || *p == '\t')
  						p++;
  					if (p[0] == '*' && p[1] == '/' && p[2] == '\n' && com) {
Index: indent/lexi.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/indent/lexi.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 lexi.c
*** lexi.c	1997/10/19 16:55:50	1.1.1.4
--- lexi.c	1998/08/24 21:06:50
***************
*** 171,184 ****
  				}
  			} else
  				while (1) {
! 					if (*buf_ptr == '.')
  						if (seendot)
  							break;
  						else
  							seendot++;
  					CHECK_SIZE_TOKEN;
  					*e_token++ = *buf_ptr++;
! 					if (!isdigit(*buf_ptr) && *buf_ptr != '.')
  						if ((*buf_ptr != 'E' && *buf_ptr != 'e') || seenexp)
  							break;
  						else {
--- 171,185 ----
  				}
  			} else
  				while (1) {
! 					if (*buf_ptr == '.') {
  						if (seendot)
  							break;
  						else
  							seendot++;
+ 					}
  					CHECK_SIZE_TOKEN;
  					*e_token++ = *buf_ptr++;
! 					if (!isdigit(*buf_ptr) && *buf_ptr != '.') {
  						if ((*buf_ptr != 'E' && *buf_ptr != 'e') || seenexp)
  							break;
  						else {
***************
*** 189,194 ****
--- 190,196 ----
  							if (*buf_ptr == '+' || *buf_ptr == '-')
  								*e_token++ = *buf_ptr++;
  						}
+ 					}
  				}
  			if (*buf_ptr == 'L' || *buf_ptr == 'l')
  				*e_token++ = *buf_ptr++;
Index: join/join.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/join/join.c,v
retrieving revision 1.1.1.5
diff -c -r1.1.1.5 join.c
*** join.c	1998/02/03 20:36:28	1.1.1.5
--- join.c	1998/08/24 21:12:30
***************
*** 477,483 ****
  {
  	if (needsep++)
  		(void)printf("%c", *tabchar);
! 	if (!ferror(stdout))
  		if (lp->fieldcnt < fieldno) {
  			if (empty != NULL)
  				(void)printf("%s", empty);
--- 477,483 ----
  {
  	if (needsep++)
  		(void)printf("%c", *tabchar);
! 	if (!ferror(stdout)) {
  		if (lp->fieldcnt < fieldno) {
  			if (empty != NULL)
  				(void)printf("%s", empty);
***************
*** 486,491 ****
--- 486,492 ----
  				return;
  			(void)printf("%s", lp->fields[fieldno]);
  		}
+ 	}
  	if (ferror(stdout))
  		err(1, "stdout");
  }
Index: last/last.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/last/last.c,v
retrieving revision 1.1.1.5
diff -c -r1.1.1.5 last.c
*** last.c	1998/07/06 15:19:18	1.1.1.5
--- last.c	1998/08/24 21:13:33
***************
*** 301,307 ****
  {
  	ARG *step;
  
! 	if (check)
  		/*
  		 * when uucp and ftp log in over a network, the entry in
  		 * the utmp file is the name plus their process id.  See
--- 301,307 ----
  {
  	ARG *step;
  
! 	if (check) {
  		/*
  		 * when uucp and ftp log in over a network, the entry in
  		 * the utmp file is the name plus their process id.  See
***************
*** 311,316 ****
--- 311,317 ----
  			bp->ut_line[3] = '\0';
  		else if (!strncmp(bp->ut_line, "uucp", sizeof("uucp") - 1))
  			bp->ut_line[4] = '\0';
+ 	}
  	if (!arglist)
  		return (YES);
  
Index: login/login.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/login/login.c,v
retrieving revision 1.1.1.18
diff -c -r1.1.1.18 login.c
*** login.c	1998/07/27 15:28:03	1.1.1.18
--- login.c	1998/08/24 21:20:15
***************
*** 429,435 ****
  
  	if (pwd->pw_change || pwd->pw_expire)
  		(void)gettimeofday(&tp, (struct timezone *)NULL);
! 	if (pwd->pw_expire)
  		if (tp.tv_sec >= pwd->pw_expire) {
  			(void)printf("Sorry -- your account has expired.\n");
  			sleepexit(1);
--- 429,435 ----
  
  	if (pwd->pw_change || pwd->pw_expire)
  		(void)gettimeofday(&tp, (struct timezone *)NULL);
! 	if (pwd->pw_expire) {
  		if (tp.tv_sec >= pwd->pw_expire) {
  			(void)printf("Sorry -- your account has expired.\n");
  			sleepexit(1);
***************
*** 437,443 ****
  		    _PASSWORD_WARNDAYS * SECSPERDAY && !quietlog)
  			(void)printf("Warning: your account expires on %s",
  			    ctime(&pwd->pw_expire));
! 	if (pwd->pw_change)
  		if (pwd->pw_change == _PASSWORD_CHGNOW)
  			need_chpass = 1;
  		else if (tp.tv_sec >= pwd->pw_change) {
--- 437,444 ----
  		    _PASSWORD_WARNDAYS * SECSPERDAY && !quietlog)
  			(void)printf("Warning: your account expires on %s",
  			    ctime(&pwd->pw_expire));
! 	}
! 	if (pwd->pw_change) {
  		if (pwd->pw_change == _PASSWORD_CHGNOW)
  			need_chpass = 1;
  		else if (tp.tv_sec >= pwd->pw_change) {
***************
*** 447,452 ****
--- 448,454 ----
  		    _PASSWORD_WARNDAYS * SECSPERDAY && !quietlog)
  			(void)printf("Warning: your password expires on %s",
  			    ctime(&pwd->pw_change));
+ 	}
  
  	/* Nothing else left to fail -- really log in. */
  	memset((void *)&utmp, 0, sizeof(utmp));
***************
*** 501,512 ****
  		syslog(LOG_INFO, "DIALUP %s, %s", tty, pwd->pw_name);
  
  	/* If fflag is on, assume caller/authenticator has logged root login. */
! 	if (rootlogin && fflag == 0)
  		if (hostname)
  			syslog(LOG_NOTICE, "ROOT LOGIN (%s) ON %s FROM %s",
  			    username, tty, hostname);
  		else
  			syslog(LOG_NOTICE, "ROOT LOGIN (%s) ON %s", username, tty);
  
  #if defined(KERBEROS) || defined(KERBEROS5)
  	if (!quietlog && notickets == 1)
--- 503,515 ----
  		syslog(LOG_INFO, "DIALUP %s, %s", tty, pwd->pw_name);
  
  	/* If fflag is on, assume caller/authenticator has logged root login. */
! 	if (rootlogin && fflag == 0) {
  		if (hostname)
  			syslog(LOG_NOTICE, "ROOT LOGIN (%s) ON %s FROM %s",
  			    username, tty, hostname);
  		else
  			syslog(LOG_NOTICE, "ROOT LOGIN (%s) ON %s", username, tty);
+ 	}
  
  #if defined(KERBEROS) || defined(KERBEROS5)
  	if (!quietlog && notickets == 1)
***************
*** 623,629 ****
  			if (p < nbuf + (NBUFSIZ - 1))
  				*p++ = ch;
  		}
! 		if (p > nbuf)
  			if (nbuf[0] == '-')
  				(void)fprintf(stderr,
  				    "login names may not start with '-'.\n");
--- 626,632 ----
  			if (p < nbuf + (NBUFSIZ - 1))
  				*p++ = ch;
  		}
! 		if (p > nbuf) {
  			if (nbuf[0] == '-')
  				(void)fprintf(stderr,
  				    "login names may not start with '-'.\n");
***************
*** 632,637 ****
--- 635,641 ----
  				username = nbuf;
  				break;
  			}
+ 		}
  	}
  }
  
Index: mail/send.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/mail/send.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 send.c
*** send.c	1998/01/14 18:28:52	1.1.1.4
--- send.c	1998/08/24 21:21:41
***************
*** 179,190 ****
  			 * Strip trailing whitespace from prefix
  			 * if line is blank.
  			 */
! 			if (prefix != NOSTR)
  				if (length > 1)
  					fputs(prefix, obuf);
  				else
  					(void) fwrite(prefix, sizeof *prefix,
  							prefixlen, obuf);
  			(void) fwrite(line, sizeof *line, length, obuf);
  			if (ferror(obuf))
  				return -1;
--- 179,191 ----
  			 * Strip trailing whitespace from prefix
  			 * if line is blank.
  			 */
! 			if (prefix != NOSTR) {
  				if (length > 1)
  					fputs(prefix, obuf);
  				else
  					(void) fwrite(prefix, sizeof *prefix,
  							prefixlen, obuf);
+ 			}
  			(void) fwrite(line, sizeof *line, length, obuf);
  			if (ferror(obuf))
  				return -1;
***************
*** 315,321 ****
  	 */
  	if ((mtf = collect(hp, printheaders)) == NULL)
  		return;
! 	if (value("interactive") != NOSTR)
  		if (value("askcc") != NOSTR || value("askbcc") != NOSTR) {
  			if (value("askcc") != NOSTR)
  				grabh(hp, GCC);
--- 316,322 ----
  	 */
  	if ((mtf = collect(hp, printheaders)) == NULL)
  		return;
! 	if (value("interactive") != NOSTR) {
  		if (value("askcc") != NOSTR || value("askbcc") != NOSTR) {
  			if (value("askcc") != NOSTR)
  				grabh(hp, GCC);
***************
*** 325,335 ****
  			printf("EOT\n");
  			(void) fflush(stdout);
  		}
! 	if (fsize(mtf) == 0)
  		if (hp->h_subject == NOSTR)
  			printf("No message, no subject; hope that's ok\n");
  		else
  			printf("Null message body; hope that's ok\n");
  	/*
  	 * Now, take the user names from the combined
  	 * to and cc lists and do all the alias
--- 326,338 ----
  			printf("EOT\n");
  			(void) fflush(stdout);
  		}
! 	}
! 	if (fsize(mtf) == 0) {
  		if (hp->h_subject == NOSTR)
  			printf("No message, no subject; hope that's ok\n");
  		else
  			printf("Null message body; hope that's ok\n");
+ 	}
  	/*
  	 * Now, take the user names from the combined
  	 * to and cc lists and do all the alias
Index: man/man.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/man/man.c,v
retrieving revision 1.1.1.7
diff -c -r1.1.1.7 man.c
*** man.c	1998/07/07 17:33:46	1.1.1.7
--- man.c	1998/08/24 21:22:52
***************
*** 143,155 ****
  	if (!*argv)
  		usage();
  
! 	if (!f_cat && !f_how && !f_where)
  		if (!isatty(1))
  			f_cat = 1;
  		else if ((pager = getenv("PAGER")) != NULL)
  			pager = check_pager(pager);
  		else
  			pager = _PATH_PAGER;
  
  	/* Read the configuration file. */
  	config(conffile);
--- 143,156 ----
  	if (!*argv)
  		usage();
  
! 	if (!f_cat && !f_how && !f_where) {
  		if (!isatty(1))
  			f_cat = 1;
  		else if ((pager = getenv("PAGER")) != NULL)
  			pager = check_pager(pager);
  		else
  			pager = _PATH_PAGER;
+ 	}
  
  	/* Read the configuration file. */
  	config(conffile);
Index: netstat/if.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/netstat/if.c,v
retrieving revision 1.1.1.9
diff -c -r1.1.1.9 if.c
*** if.c	1998/07/13 15:26:39	1.1.1.9
--- if.c	1998/08/24 19:41:24
***************
*** 365,371 ****
  	}
  	if (dflag)
  		printf("%5.5s ", "drops");
! 	if (lastif - iftot > 0)
  		if (bflag) {
  			printf("%10.10s %8.8s %10.10s %5.5s",
  				"bytes", " ", "bytes", " ");
--- 365,371 ----
  	}
  	if (dflag)
  		printf("%5.5s ", "drops");
! 	if (lastif - iftot > 0) {
  		if (bflag) {
  			printf("%10.10s %8.8s %10.10s %5.5s",
  				"bytes", " ", "bytes", " ");
***************
*** 373,378 ****
--- 373,379 ----
  			printf("%8.8s %5.5s %8.8s %5.5s %5.5s ",
  				"packets", "errs", "packets", "errs", "colls");
  		}
+ 	}
  	if (dflag)
  		printf(" %5.5s", "drops");
  	putchar('\n');
Index: netstat/inet.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/netstat/inet.c,v
retrieving revision 1.1.1.11
diff -c -r1.1.1.11 inet.c
*** inet.c	1998/07/26 16:58:04	1.1.1.11
--- inet.c	1998/08/24 19:41:06
***************
*** 140,150 ****
  				"Local Address", "Foreign Address", "(state)");
  			first = 0;
  		}
! 		if (Aflag)
  			if (istcp)
  				printf("%8lx ", (u_long) inpcb.inp_ppcb);
  			else
  				printf("%8lx ", (u_long) prev);
  		printf("%-5.5s %6ld %6ld ", name, sockb.so_rcv.sb_cc,
  			sockb.so_snd.sb_cc);
  		if (nflag) {
--- 140,151 ----
  				"Local Address", "Foreign Address", "(state)");
  			first = 0;
  		}
! 		if (Aflag) {
  			if (istcp)
  				printf("%8lx ", (u_long) inpcb.inp_ppcb);
  			else
  				printf("%8lx ", (u_long) prev);
+ 		}
  		printf("%-5.5s %6ld %6ld ", name, sockb.so_rcv.sb_cc,
  			sockb.so_snd.sb_cc);
  		if (nflag) {
Index: quota/quota.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/quota/quota.c,v
retrieving revision 1.1.1.9
diff -c -r1.1.1.9 quota.c
*** quota.c	1998/07/27 15:28:18	1.1.1.9
--- quota.c	1998/08/24 21:30:54
***************
*** 334,354 ****
  		    qup->dqblk.dqb_curinodes >= qup->dqblk.dqb_ihardlimit)
  			msgi = "File limit reached on";
  		else if (qup->dqblk.dqb_isoftlimit &&
! 		    qup->dqblk.dqb_curinodes >= qup->dqblk.dqb_isoftlimit)
  			if (qup->dqblk.dqb_itime > now)
  				msgi = "In file grace period on";
  			else
  				msgi = "Over file quota on";
  		msgb = (char *)0;
  		if (qup->dqblk.dqb_bhardlimit &&
  		    qup->dqblk.dqb_curblocks >= qup->dqblk.dqb_bhardlimit)
  			msgb = "Block limit reached on";
  		else if (qup->dqblk.dqb_bsoftlimit &&
! 		    qup->dqblk.dqb_curblocks >= qup->dqblk.dqb_bsoftlimit)
  			if (qup->dqblk.dqb_btime > now)
  				msgb = "In block grace period on";
  			else
  				msgb = "Over block quota on";
  		if (qflag) {
  			if ((msgi != (char *)0 || msgb != (char *)0) &&
  			    lines++ == 0)
--- 334,356 ----
  		    qup->dqblk.dqb_curinodes >= qup->dqblk.dqb_ihardlimit)
  			msgi = "File limit reached on";
  		else if (qup->dqblk.dqb_isoftlimit &&
! 		    qup->dqblk.dqb_curinodes >= qup->dqblk.dqb_isoftlimit) {
  			if (qup->dqblk.dqb_itime > now)
  				msgi = "In file grace period on";
  			else
  				msgi = "Over file quota on";
+ 		}
  		msgb = (char *)0;
  		if (qup->dqblk.dqb_bhardlimit &&
  		    qup->dqblk.dqb_curblocks >= qup->dqblk.dqb_bhardlimit)
  			msgb = "Block limit reached on";
  		else if (qup->dqblk.dqb_bsoftlimit &&
! 		    qup->dqblk.dqb_curblocks >= qup->dqblk.dqb_bsoftlimit) {
  			if (qup->dqblk.dqb_btime > now)
  				msgb = "In block grace period on";
  			else
  				msgb = "Over block quota on";
+ 		}
  		if (qflag) {
  			if ((msgi != (char *)0 || msgb != (char *)0) &&
  			    lines++ == 0)
Index: rdist/expand.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/rdist/expand.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 expand.c
*** expand.c	1997/10/20 21:42:34	1.1.1.4
--- expand.c	1998/08/24 21:32:03
***************
*** 516,522 ****
  			while (*s)
  				addpath(*s++);
  			addpath('/');
! 			if (stat(path, &stb) == 0 && S_ISDIR(stb.st_mode))
  				if (*p == '\0') {
  					if (which & E_TILDE)
  						Cat(path, "");
--- 516,522 ----
  			while (*s)
  				addpath(*s++);
  			addpath('/');
! 			if (stat(path, &stb) == 0 && S_ISDIR(stb.st_mode)) {
  				if (*p == '\0') {
  					if (which & E_TILDE)
  						Cat(path, "");
***************
*** 524,529 ****
--- 524,530 ----
  						Cat(tilde, tpathp);
  				} else
  					expsh(p);
+ 			}
  			pathp = spathp;
  			*pathp = '\0';
  			return (0);
Index: rpcgen/rpc_cout.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/rpcgen/rpc_cout.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 rpc_cout.c
*** rpc_cout.c	1997/10/19 17:02:42	1.1.1.4
--- rpc_cout.c	1998/08/24 21:34:26
***************
*** 497,503 ****
  				}
  
  			} else {
! 				if (i > 0)
  					if (sizestr == NULL && size < doinline) {
  						/* don't expand into inline
  						 * code if size < doinline */
--- 497,503 ----
  				}
  
  			} else {
! 				if (i > 0) {
  					if (sizestr == NULL && size < doinline) {
  						/* don't expand into inline
  						 * code if size < doinline */
***************
*** 542,547 ****
--- 542,548 ----
  
  						f_print(fout, "\t\t}\n");
  					}
+ 				}
  				size = 0;
  				i = 0;
  				sizestr = NULL;
***************
*** 549,555 ****
  			}
  
  		}
! 		if (i > 0)
  			if (sizestr == NULL && size < doinline) {
  				/* don't expand into inline code if size <
  				 * doinline */
--- 550,556 ----
  			}
  
  		}
! 		if (i > 0) {
  			if (sizestr == NULL && size < doinline) {
  				/* don't expand into inline code if size <
  				 * doinline */
***************
*** 592,597 ****
--- 593,599 ----
  				f_print(fout, "\t\t}\n");
  
  			}
+ 		}
  
  		if (flag == PUT) {
  			flag = GET;
Index: sed/process.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/sed/process.c,v
retrieving revision 1.1.1.7
diff -c -r1.1.1.7 process.c
*** process.c	1998/03/31 15:11:19	1.1.1.7
--- process.c	1998/08/24 21:45:08
***************
*** 470,476 ****
  	struct winsize win;
  	static int termwidth = -1;
  
! 	if (termwidth == -1)
  		if ((p = getenv("COLUMNS")) != NULL)
  			termwidth = atoi(p);
  		else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 &&
--- 470,476 ----
  	struct winsize win;
  	static int termwidth = -1;
  
! 	if (termwidth == -1) {
  		if ((p = getenv("COLUMNS")) != NULL)
  			termwidth = atoi(p);
  		else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 &&
***************
*** 478,483 ****
--- 478,484 ----
  			termwidth = win.ws_col;
  		else
  			termwidth = 60;
+ 	}
  
  	for (count = 0; *s; ++s) { 
  		if (count >= termwidth) {
Index: su/su.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/su/su.c,v
retrieving revision 1.1.1.14
diff -c -r1.1.1.14 su.c
*** su.c	1998/07/27 15:28:26	1.1.1.14
--- su.c	1998/08/24 21:55:24
***************
*** 158,164 ****
  	if (username == NULL)
  		err(1, "strdup");
  
! 	if (asme)
  		if (pwd->pw_shell && *pwd->pw_shell) {
  			shell = strncpy(shellbuf, pwd->pw_shell,
  			    sizeof(shellbuf) - 1);
--- 158,164 ----
  	if (username == NULL)
  		err(1, "strdup");
  
! 	if (asme) {
  		if (pwd->pw_shell && *pwd->pw_shell) {
  			shell = strncpy(shellbuf, pwd->pw_shell,
  			    sizeof(shellbuf) - 1);
***************
*** 167,172 ****
--- 167,173 ----
  			shell = _PATH_BSHELL;
  			iscsh = NO;
  		}
+ 	}
  
  	/* get target login information, default to root */
  	user = *argv ? *argv : "root";
***************
*** 291,297 ****
  
  	if (pwd->pw_change || pwd->pw_expire)
  		(void)gettimeofday(&tp, (struct timezone *)NULL);
! 	if (pwd->pw_change)
  		if (tp.tv_sec >= pwd->pw_change) {
  			(void)printf("%s -- %s's password has expired.\n",
  				     (ruid ? "Sorry" : "Note"), user);
--- 292,298 ----
  
  	if (pwd->pw_change || pwd->pw_expire)
  		(void)gettimeofday(&tp, (struct timezone *)NULL);
! 	if (pwd->pw_change) {
  		if (tp.tv_sec >= pwd->pw_change) {
  			(void)printf("%s -- %s's password has expired.\n",
  				     (ruid ? "Sorry" : "Note"), user);
***************
*** 301,307 ****
  		    _PASSWORD_WARNDAYS * SECSPERDAY)
  			(void)printf("Warning: %s's password expires on %s",
  				     user, ctime(&pwd->pw_change));
! 	if (pwd->pw_expire)
  		if (tp.tv_sec >= pwd->pw_expire) {
  			(void)printf("%s -- %s's account has expired.\n",
  				     (ruid ? "Sorry" : "Note"), user);
--- 302,309 ----
  		    _PASSWORD_WARNDAYS * SECSPERDAY)
  			(void)printf("Warning: %s's password expires on %s",
  				     user, ctime(&pwd->pw_change));
! 	}
! 	if (pwd->pw_expire) {
  		if (tp.tv_sec >= pwd->pw_expire) {
  			(void)printf("%s -- %s's account has expired.\n",
  				     (ruid ? "Sorry" : "Note"), user);
***************
*** 311,316 ****
--- 313,319 ----
  		    _PASSWORD_WARNDAYS * SECSPERDAY)
  			(void)printf("Warning: %s's account expires on %s",
  				     user, ctime(&pwd->pw_expire));
+ 	}
    
  	if (ruid != 0)
  		syslog(LOG_NOTICE|LOG_AUTH, "%s to %s%s",
Index: systat/netstat.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/systat/netstat.c,v
retrieving revision 1.1.1.5
diff -c -r1.1.1.5 netstat.c
*** netstat.c	1998/07/13 15:27:51	1.1.1.5
--- netstat.c	1998/08/24 20:06:24
***************
*** 363,375 ****
  		mvwaddstr(wnd, p->ni_line, PROTO, p->ni_proto);
  		mvwprintw(wnd, p->ni_line, RCVCC, "%6d", p->ni_rcvcc);
  		mvwprintw(wnd, p->ni_line, SNDCC, "%6d", p->ni_sndcc);
! 		if (streq(p->ni_proto, "tcp"))
  			if (p->ni_state < 0 || p->ni_state >= TCP_NSTATES)
  				mvwprintw(wnd, p->ni_line, STATE, "%d",
  				    p->ni_state);
  			else
  				mvwaddstr(wnd, p->ni_line, STATE,
  				    tcpstates[p->ni_state]);
  		wclrtoeol(wnd);
  	}
  	if (lastrow < getmaxy(wnd)) {
--- 363,376 ----
  		mvwaddstr(wnd, p->ni_line, PROTO, p->ni_proto);
  		mvwprintw(wnd, p->ni_line, RCVCC, "%6d", p->ni_rcvcc);
  		mvwprintw(wnd, p->ni_line, SNDCC, "%6d", p->ni_sndcc);
! 		if (streq(p->ni_proto, "tcp")) {
  			if (p->ni_state < 0 || p->ni_state >= TCP_NSTATES)
  				mvwprintw(wnd, p->ni_line, STATE, "%d",
  				    p->ni_state);
  			else
  				mvwaddstr(wnd, p->ni_line, STATE,
  				    tcpstates[p->ni_state]);
+ 		}
  		wclrtoeol(wnd);
  	}
  	if (lastrow < getmaxy(wnd)) {
Index: tail/tail.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/tail/tail.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 tail.c
*** tail.c	1998/02/10 19:34:58	1.1.1.3
--- tail.c	1998/08/24 20:06:46
***************
*** 158,164 ****
  	 * If style not specified, the default is the whole file for -r, and
  	 * the last 10 lines if not -r.
  	 */
! 	if (style == NOTSET)
  		if (rflag) {
  			off = 0;
  			style = REVERSE;
--- 158,164 ----
  	 * If style not specified, the default is the whole file for -r, and
  	 * the last 10 lines if not -r.
  	 */
! 	if (style == NOTSET) {
  		if (rflag) {
  			off = 0;
  			style = REVERSE;
***************
*** 166,171 ****
--- 166,172 ----
  			off = 10;
  			style = RLINES;
  		}
+ 	}
  
  	if (*argv)
  		for (first = 1; (fname = *argv++) != NULL;) {
Index: tcopy/tcopy.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/tcopy/tcopy.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 tcopy.c
*** tcopy.c	1997/10/20 21:47:10	1.1.1.3
--- tcopy.c	1998/08/24 20:13:36
***************
*** 296,306 ****
  intr(signo)
  	int signo;
  {
! 	if (record)
  		if (record - lastrec > 1)
  			fprintf(msg, "records %ld to %ld\n", lastrec, record);
  		else
  			fprintf(msg, "record %ld\n", lastrec);
  	fprintf(msg, "interrupt at file %d: record %ld\n", filen, record);
  	fprintf(msg, "total length: %qd bytes\n", (long long)(tsize + size));
  	exit(1);
--- 296,307 ----
  intr(signo)
  	int signo;
  {
! 	if (record) {
  		if (record - lastrec > 1)
  			fprintf(msg, "records %ld to %ld\n", lastrec, record);
  		else
  			fprintf(msg, "record %ld\n", lastrec);
+ 	}
  	fprintf(msg, "interrupt at file %d: record %ld\n", filen, record);
  	fprintf(msg, "total length: %qd bytes\n", (long long)(tsize + size));
  	exit(1);
Index: tip/cmds.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/tip/cmds.c,v
retrieving revision 1.1.1.5
diff -c -r1.1.1.5 cmds.c
*** cmds.c	1998/07/13 15:28:06	1.1.1.5
--- cmds.c	1998/08/25 04:45:07
***************
*** 385,395 ****
  	stop_t = time(0);
  	fclose(fd);
  	signal(SIGINT, f);
! 	if (boolean(value(VERBOSE)))
  		if (boolean(value(RAWFTP)))
  			prtime(" chars transferred in ", stop_t-start_t);
  		else
  			prtime(" lines transferred in ", stop_t-start_t);
  	write(fildes[1], (char *)&ccc, 1);
  	tcsetattr(0, TCSAFLUSH, &term);
  }
--- 385,396 ----
  	stop_t = time(0);
  	fclose(fd);
  	signal(SIGINT, f);
! 	if (boolean(value(VERBOSE))) {
  		if (boolean(value(RAWFTP)))
  			prtime(" chars transferred in ", stop_t-start_t);
  		else
  			prtime(" lines transferred in ", stop_t-start_t);
+ 	}
  	write(fildes[1], (char *)&ccc, 1);
  	tcsetattr(0, TCSAFLUSH, &term);
  }
Index: tip/log.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/tip/log.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 log.c
*** log.c	1998/07/27 15:28:46	1.1.1.3
--- log.c	1998/08/25 04:46:06
***************
*** 65,75 ****
  		perror("tip: flock");
  		return;
  	}
! 	if ((user = getlogin()) == NULL)
  		if ((pwd = getpwuid(getuid())) == NULL)
  			user = "???";
  		else
  			user = pwd->pw_name;
  	t = time(0);
  	timestamp = ctime(&t);
  	timestamp[24] = '\0';
--- 65,76 ----
  		perror("tip: flock");
  		return;
  	}
! 	if ((user = getlogin()) == NULL) {
  		if ((pwd = getpwuid(getuid())) == NULL)
  			user = "???";
  		else
  			user = pwd->pw_name;
+ 	}
  	t = time(0);
  	timestamp = ctime(&t);
  	timestamp[24] = '\0';
Index: tip/remote.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/tip/remote.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 remote.c
*** remote.c	1998/01/14 18:32:06	1.1.1.4
--- remote.c	1998/08/25 04:46:25
***************
*** 80,86 ****
  	int   stat;
  
  	rempath = getenv("REMOTE");
! 	if (rempath != NULL)
  		if (*rempath != '/')
  			/* we have an entry */
  			cgetset(rempath);
--- 80,86 ----
  	int   stat;
  
  	rempath = getenv("REMOTE");
! 	if (rempath != NULL) {
  		if (*rempath != '/')
  			/* we have an entry */
  			cgetset(rempath);
***************
*** 88,93 ****
--- 88,94 ----
  			db_array[1] = rempath;
  			db_array[2] = _PATH_REMOTE;
  		}
+ 	}
  
  	if ((stat = cgetent(&bp, db_array, host)) < 0) {
  		if (DV ||
Index: touch/touch.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/touch/touch.c,v
retrieving revision 1.1.1.7
diff -c -r1.1.1.7 touch.c
*** touch.c	1998/01/22 05:38:18	1.1.1.7
--- touch.c	1998/08/25 04:48:56
***************
*** 153,159 ****
  
  	for (rval = 0; *argv; ++argv) {
  		/* See if the file exists. */
! 		if ((*get_file_status)(*argv, &sb))
  			if (!cflag) {
  				/* Create the file. */
  				fd = open(*argv,
--- 153,159 ----
  
  	for (rval = 0; *argv; ++argv) {
  		/* See if the file exists. */
! 		if ((*get_file_status)(*argv, &sb)) {
  			if (!cflag) {
  				/* Create the file. */
  				fd = open(*argv,
***************
*** 169,174 ****
--- 169,175 ----
  					continue;
  			} else
  				continue;
+ 		}
  
  		if (!aflag)
  			TIMESPEC_TO_TIMEVAL(&tv[0], &sb.st_atimespec);
Index: tset/term.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/tset/term.c,v
retrieving revision 1.1.1.4
diff -c -r1.1.1.4 term.c
*** term.c	1998/07/27 15:28:57	1.1.1.4
--- term.c	1998/08/24 20:44:02
***************
*** 109,119 ****
  	 * ttype now contains a pointer to the type of the terminal.
  	 * If the first character is '?', ask the user.
  	 */
! 	if (ttype[0] == '?')
  		if (ttype[1] != '\0')
  			ttype = askuser(ttype + 1);
  		else
  			ttype = askuser(NULL);
  
  	/* Find the termcap entry.  If it doesn't exist, ask the user. */
  	while ((rval = tgetent(tbuf, ttype)) == 0) {
--- 109,120 ----
  	 * ttype now contains a pointer to the type of the terminal.
  	 * If the first character is '?', ask the user.
  	 */
! 	if (ttype[0] == '?') {
  		if (ttype[1] != '\0')
  			ttype = askuser(ttype + 1);
  		else
  			ttype = askuser(NULL);
+ 	}
  
  	/* Find the termcap entry.  If it doesn't exist, ask the user. */
  	while ((rval = tgetent(tbuf, ttype)) == 0) {
Index: tsort/tsort.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/tsort/tsort.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 tsort.c
*** tsort.c	1997/10/20 21:48:41	1.1.1.2
--- tsort.c	1998/08/24 20:44:36
***************
*** 345,351 ****
  				err(1, "malloc");
  		}
  		for (n = graph; n != NULL; n = n->n_next)
! 			if (!(n->n_flags & NF_ACYCLIC))
  				if ((cnt = find_cycle(n, n, 0, 0)) != 0) {
  					if (!quiet) {
  						warnx("cycle in data");
--- 345,351 ----
  				err(1, "malloc");
  		}
  		for (n = graph; n != NULL; n = n->n_next)
! 			if (!(n->n_flags & NF_ACYCLIC)) {
  				if ((cnt = find_cycle(n, n, 0, 0)) != 0) {
  					if (!quiet) {
  						warnx("cycle in data");
***************
*** 361,366 ****
--- 361,367 ----
  					n->n_flags  |= NF_ACYCLIC;
  					clear_cycle();
  				}
+ 			}
  
  		if (n == NULL)
  			errx(1, "internal error -- could not find cycle");
Index: window/cmd.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/window/cmd.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 cmd.c
*** cmd.c	1998/01/14 18:40:48	1.1.1.2
--- cmd.c	1998/08/24 21:47:03
***************
*** 290,301 ****
  setterse(new)
  	char new;
  {
! 	if (incmd)
  		if (new && !terse) {
  			wwdelete(cmdwin);
  			reframe();
  		} else if (!new && terse)
  			wwadd(cmdwin, &wwhead);
  	terse = new;
  }
  
--- 290,302 ----
  setterse(new)
  	char new;
  {
! 	if (incmd) {
  		if (new && !terse) {
  			wwdelete(cmdwin);
  			reframe();
  		} else if (!new && terse)
  			wwadd(cmdwin, &wwhead);
+ 	}
  	terse = new;
  }
  
Index: window/lcmd2.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/window/lcmd2.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 lcmd2.c
*** lcmd2.c	1998/01/14 18:41:24	1.1.1.2
--- lcmd2.c	1998/08/24 21:50:16
***************
*** 288,298 ****
  			p_memerror();
  			break;
  		}
! 	if ((default_shellfile = *default_shell))
  		if ((*default_shell = strrchr(default_shellfile, '/')))
  			(*default_shell)++;
  		else
  			*default_shell = default_shellfile;
  }
  
  struct lcmd_arg arg_alias[] = {
--- 288,299 ----
  			p_memerror();
  			break;
  		}
! 	if ((default_shellfile = *default_shell)) {
  		if ((*default_shell = strrchr(default_shellfile, '/')))
  			(*default_shell)++;
  		else
  			*default_shell = default_shellfile;
+ 	}
  }
  
  struct lcmd_arg arg_alias[] = {
Index: window/parser2.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/window/parser2.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 parser2.c
*** parser2.c	1998/01/14 18:41:36	1.1.1.2
--- parser2.c	1998/08/24 21:52:25
***************
*** 70,76 ****
  	struct value av[LCMD_NARG + 1];
  	struct value *vp;
  
! 	if (name != 0)
  		if ((c = lcmd_lookup(name)))
  			name = c->lc_name;
  		else if ((a = alias_lookup(name)))
--- 70,76 ----
  	struct value av[LCMD_NARG + 1];
  	struct value *vp;
  
! 	if (name != 0) {
  		if ((c = lcmd_lookup(name)))
  			name = c->lc_name;
  		else if ((a = alias_lookup(name)))
***************
*** 79,84 ****
--- 79,85 ----
  			p_error("%s: No such command or alias.", name);
  			flag = 0;
  		}
+ 	}
  
  	for (vp = av; vp < &av[LCMD_NARG + 1]; vp++)
  		vp->v_type = V_ERR;
***************
*** 190,196 ****
  	else if (token != T_EOL && token != T_EOF)
  		flag = 0;		/* look for legal follow set */
  	v->v_type = V_ERR;
! 	if (flag)
  		if (c != 0)
  			(*c->lc_func)(v, av);
  		else
--- 191,197 ----
  	else if (token != T_EOL && token != T_EOF)
  		flag = 0;		/* look for legal follow set */
  	v->v_type = V_ERR;
! 	if (flag) {
  		if (c != 0)
  			(*c->lc_func)(v, av);
  		else
***************
*** 202,207 ****
--- 203,209 ----
  					p_memerror();
  				a->a_flags &= ~A_INUSE;
  			}
+ 	}
  	if (p_abort()) {
  		val_free(*v);
  		v->v_type = V_ERR;
Index: window/scanner.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/window/scanner.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 scanner.c
*** scanner.c	1998/01/14 18:41:45	1.1.1.2
--- scanner.c	1998/08/24 21:52:59
***************
*** 317,328 ****
  				    && buf[3] == 'i' && buf[4] == 'f'
  				    && buf[5] == 0)
  					cx.x_token = T_ENDIF;
! 				else if (buf[1] == 'l' && buf[2] == 's')
  					if (buf[3] == 'i' && buf[4] == 'f'
  					    && buf[5] == 0)
  						cx.x_token = T_ELSIF;
  					else if (buf[3] == 'e' && buf[4] == 0)
  						cx.x_token = T_ELSE;
  				break;
  			}
  			if (cx.x_token == T_STR
--- 317,329 ----
  				    && buf[3] == 'i' && buf[4] == 'f'
  				    && buf[5] == 0)
  					cx.x_token = T_ENDIF;
! 				else if (buf[1] == 'l' && buf[2] == 's') {
  					if (buf[3] == 'i' && buf[4] == 'f'
  					    && buf[5] == 0)
  						cx.x_token = T_ELSIF;
  					else if (buf[3] == 'e' && buf[4] == 0)
  						cx.x_token = T_ELSE;
+ 				}
  				break;
  			}
  			if (cx.x_token == T_STR
Index: window/ttgeneric.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/window/ttgeneric.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 ttgeneric.c
*** ttgeneric.c	1998/01/14 18:41:59	1.1.1.2
--- ttgeneric.c	1998/08/24 21:53:58
***************
*** 237,249 ****
  	if (tt.tt_nmodes != tt.tt_modes)
  		gen_setmodes(tt.tt_nmodes);
  	ttputc(c);
! 	if (++tt.tt_col == gen_CO)
  		if (gen_XN)
  			tt.tt_col = tt.tt_row = -10;
  		else if (gen_AM)
  			tt.tt_col = 0, tt.tt_row++;
  		else
  			tt.tt_col--;
  }
  
  void
--- 237,250 ----
  	if (tt.tt_nmodes != tt.tt_modes)
  		gen_setmodes(tt.tt_nmodes);
  	ttputc(c);
! 	if (++tt.tt_col == gen_CO) {
  		if (gen_XN)
  			tt.tt_col = tt.tt_row = -10;
  		else if (gen_AM)
  			tt.tt_col = 0, tt.tt_row++;
  		else
  			tt.tt_col--;
+ 	}
  }
  
  void
***************
*** 257,269 ****
  		gen_setmodes(tt.tt_nmodes);
  	ttwrite(p, n);
  	tt.tt_col += n;
! 	if (tt.tt_col == gen_CO)
  		if (gen_XN)
  			tt.tt_col = tt.tt_row = -10;
  		else if (gen_AM)
  			tt.tt_col = 0, tt.tt_row++;
  		else
  			tt.tt_col--;
  }
  
  void
--- 258,271 ----
  		gen_setmodes(tt.tt_nmodes);
  	ttwrite(p, n);
  	tt.tt_col += n;
! 	if (tt.tt_col == gen_CO) {
  		if (gen_XN)
  			tt.tt_col = tt.tt_row = -10;
  		else if (gen_AM)
  			tt.tt_col = 0, tt.tt_row++;
  		else
  			tt.tt_col--;
+ 	}
  }
  
  void
***************
*** 377,389 ****
  	ttputc(c);
  	if (gen_IP)
  		tttputs(gen_IP, gen_CO - tt.tt_col);
! 	if (++tt.tt_col == gen_CO)
  		if (gen_XN)
  			tt.tt_col = tt.tt_row = -10;
  		else if (gen_AM)
  			tt.tt_col = 0, tt.tt_row++;
  		else
  			tt.tt_col--;
  }
  
  void
--- 379,392 ----
  	ttputc(c);
  	if (gen_IP)
  		tttputs(gen_IP, gen_CO - tt.tt_col);
! 	if (++tt.tt_col == gen_CO) {
  		if (gen_XN)
  			tt.tt_col = tt.tt_row = -10;
  		else if (gen_AM)
  			tt.tt_col = 0, tt.tt_row++;
  		else
  			tt.tt_col--;
+  	}
  }
  
  void
***************
*** 508,520 ****
  	/*
  	 * Deal with obsolete termcap fields.
  	 */
! 	if (gen_LE == 0)
  		if (gen_BC)
  			gen_LE = gen_BC;
  		else if (gen_BS) {
  			static struct tt_str bc = { "\b", 1 };
  			gen_BC = &bc;
  		}
  	if (gen_NL == 0) {
  		static struct tt_str nl = { "\n", 1 };
  		gen_NL = &nl;
--- 511,524 ----
  	/*
  	 * Deal with obsolete termcap fields.
  	 */
! 	if (gen_LE == 0) {
  		if (gen_BC)
  			gen_LE = gen_BC;
  		else if (gen_BS) {
  			static struct tt_str bc = { "\b", 1 };
  			gen_BC = &bc;
  		}
+ 	}
  	if (gen_NL == 0) {
  		static struct tt_str nl = { "\n", 1 };
  		gen_NL = &nl;
Index: window/win.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/window/win.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 win.c
*** win.c	1998/01/14 18:42:29	1.1.1.2
--- win.c	1998/08/24 22:02:48
***************
*** 163,174 ****
  			didit++;
  		}
  	if (didit) {
! 		if (selwin == 0)
  			if (lastselwin != 0) {
  				setselwin(lastselwin);
  				lastselwin = 0;
  			} else if ((w = findselwin()))
  				setselwin(w);
  		if (lastselwin == 0 && selwin)
  			if ((w = findselwin()))
  				lastselwin = w;
--- 163,175 ----
  			didit++;
  		}
  	if (didit) {
! 		if (selwin == 0) {
  			if (lastselwin != 0) {
  				setselwin(lastselwin);
  				lastselwin = 0;
  			} else if ((w = findselwin()))
  				setselwin(w);
+ 		}
  		if (lastselwin == 0 && selwin)
  			if ((w = findselwin()))
  				lastselwin = w;
Index: window/wwopen.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/window/wwopen.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 wwopen.c
*** wwopen.c	1998/07/26 16:58:36	1.1.1.3
--- wwopen.c	1998/08/24 21:57:45
***************
*** 142,152 ****
  	m = 0;
  	if (oflags & WWO_GLASS)
  		m |= WWM_GLS;
! 	if (oflags & WWO_REVERSE)
  		if (wwavailmodes & WWM_REV)
  			m |= WWM_REV;
  		else
  			oflags &= ~WWO_REVERSE;
  	for (i = w->ww_w.t; i < w->ww_w.b; i++)
  		for (j = w->ww_w.l; j < w->ww_w.r; j++)
  			w->ww_win[i][j] = m;
--- 142,153 ----
  	m = 0;
  	if (oflags & WWO_GLASS)
  		m |= WWM_GLS;
! 	if (oflags & WWO_REVERSE) {
  		if (wwavailmodes & WWM_REV)
  			m |= WWM_REV;
  		else
  			oflags &= ~WWO_REVERSE;
+ 	}
  	for (i = w->ww_w.t; i < w->ww_w.b; i++)
  		for (j = w->ww_w.l; j < w->ww_w.r; j++)
  			w->ww_win[i][j] = m;
Index: write/write.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/write/write.c,v
retrieving revision 1.1.1.8
diff -c -r1.1.1.8 write.c
*** write.c	1998/07/27 15:29:17	1.1.1.8
--- write.c	1998/08/24 22:03:45
***************
*** 264,274 ****
  	char path[MAXPATHLEN], host[MAXHOSTNAMELEN + 1], line[512];
  
  	/* Determine our login name before the we reopen() stdout */
! 	if ((login = getlogin()) == NULL)
  		if ((pwd = getpwuid(myuid)) != NULL)
  			login = pwd->pw_name;
  		else
  			login = "???";
  
  	(void)snprintf(path, sizeof path, "/dev/%s", tty);
  	if ((freopen(path, "w", stdout)) == NULL)
--- 264,275 ----
  	char path[MAXPATHLEN], host[MAXHOSTNAMELEN + 1], line[512];
  
  	/* Determine our login name before the we reopen() stdout */
! 	if ((login = getlogin()) == NULL) {
  		if ((pwd = getpwuid(myuid)) != NULL)
  			login = pwd->pw_name;
  		else
  			login = "???";
+ 	}
  
  	(void)snprintf(path, sizeof path, "/dev/%s", tty);
  	if ((freopen(path, "w", stdout)) == NULL)
Index: yacc/mkpar.c
===================================================================
RCS file: /home/cvs-base/src/usr.bin/yacc/mkpar.c,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 mkpar.c
*** mkpar.c	1997/07/26 17:00:29	1.1.1.2
--- mkpar.c	1998/08/25 04:26:27
***************
*** 250,260 ****
      for (i = 3; i < nrules; ++i)
  	if (!rules_used[i]) ++nunused;
  
!     if (nunused)
  	if (nunused == 1)
  	    fprintf(stderr, "%s: 1 rule never reduced\n", myname);
  	else
  	    fprintf(stderr, "%s: %d rules never reduced\n", myname, nunused);
  }
  
  
--- 250,261 ----
      for (i = 3; i < nrules; ++i)
  	if (!rules_used[i]) ++nunused;
  
!     if (nunused) {
  	if (nunused == 1)
  	    fprintf(stderr, "%s: 1 rule never reduced\n", myname);
  	else
  	    fprintf(stderr, "%s: %d rules never reduced\n", myname, nunused);
+     }
  }
  
  
>Audit-Trail:
>Unformatted: