Subject: usr.bin/finger/lprint.c patch
To: None <netbsd-bugs@sun-lamp.cs.berkeley.edu>
From: Ben Jackson <bj@lv426.cc.purdue.edu>
List: netbsd-bugs
Date: 12/03/1993 01:46:15
There was a newline before the contents of the `.project' file was printed
out, giving output like:

Project:
this is my project...

instead of:

Project: this is my project.

You might not consider it a bug; I do.

--Ben

---8<--- cut here ---8<---
*** usr.bin/finger/lprint.c	Fri Dec  3 01:40:29 1993
--- local/bin/finger/lprint.c	Fri Dec  3 01:42:24 1993
***************
*** 62,69 ****
  	for (pn = phead;;) {
  		lprint(pn);
  		if (!pplan) {
! 			(void)show_text(pn->dir, _PATH_PROJECT, "Project:");
! 			if (!show_text(pn->dir, _PATH_PLAN, "Plan:"))
  				(void)printf("No Plan.\n");
  		}
  		if (!(pn = pn->next))
--- 62,69 ----
  	for (pn = phead;;) {
  		lprint(pn);
  		if (!pplan) {
! 			(void)show_text(pn->dir, _PATH_PROJECT, "Project: ");
! 			if (!show_text(pn->dir, _PATH_PLAN, "Plan:\n"))
  				(void)printf("No Plan.\n");
  		}
  		if (!(pn = pn->next))
***************
*** 265,271 ****
  	(void)sprintf(tbuf, "%s/%s", directory, file_name);
  	if ((fp = fopen(tbuf, "r")) == NULL)
  		return(0);
! 	(void)printf("%s\n", header);
  	while ((ch = getc(fp)) != EOF)
  		vputc(lastc = ch);
  	if (lastc != '\n')
--- 265,271 ----
  	(void)sprintf(tbuf, "%s/%s", directory, file_name);
  	if ((fp = fopen(tbuf, "r")) == NULL)
  		return(0);
! 	(void)printf("%s", header);
  	while ((ch = getc(fp)) != EOF)
  		vputc(lastc = ch);
  	if (lastc != '\n')

------------------------------------------------------------------------------