[net.sources.bugs] trw read bug...

myers@uwmacc.UUCP (Jeff Myers) (05/23/85)

The code is munged in readtp.c for the case when you want to read in files
from the tape without assigning a new name, or for the case when you accept
the default for a certain file.  A context diff follows (the first change is
cosmetic):

*** readtp.c.old	Wed May 22 17:13:27 1985
--- readtp.c	Wed May 22 15:36:48 1985
***************
*** 122,128
  	{
  		printf("Current File Name:  ");
  		putline(inptbuf+4, 17);
! 		printf("\n\nNew File Name:  ");
  		eread(ufname);
  	}
  	if ((fname[0] == 0) || keep)

--- 122,128 -----
  	{
  		printf("Current File Name:  ");
  		putline(inptbuf+4, 17);
! 		printf("\nNew File Name:  ");
  		eread(ufname);
  	}
  	if ((ufname[0] == 0) || keep)
***************
*** 125,131
  		printf("\n\nNew File Name:  ");
  		eread(ufname);
  	}
! 	if ((fname[0] == 0) || keep)
  		for (i=4, j=0; j<17; ++i, ++j)
  			fname[j] = isupper(inptbuf[i]) ? tolower(inptbuf[i]) : inptbuf[i];
  	if ((ofp = fopen(ufname, "w")) == NULL)

--- 125,132 -----
  		printf("\nNew File Name:  ");
  		eread(ufname);
  	}
! 	if ((ufname[0] == 0) || keep)
! 	{
  		for (i=4, j=0; j<17; ++i, ++j)
  			fname[j] = isupper(inptbuf[i]) ? tolower(inptbuf[i]) : inptbuf[i];
  		if ((ofp = fopen(fname, "w")) == NULL)
***************
*** 128,134
  	if ((fname[0] == 0) || keep)
  		for (i=4, j=0; j<17; ++i, ++j)
  			fname[j] = isupper(inptbuf[i]) ? tolower(inptbuf[i]) : inptbuf[i];
! 	if ((ofp = fopen(ufname, "w")) == NULL)
  		err(FOPERR);
  	eov = 0;
  }

--- 129,138 -----
  	{
  		for (i=4, j=0; j<17; ++i, ++j)
  			fname[j] = isupper(inptbuf[i]) ? tolower(inptbuf[i]) : inptbuf[i];
! 		if ((ofp = fopen(fname, "w")) == NULL)
! 			err(FOPERR);
! 	}
! 	else if ((ofp = fopen(ufname, "w")) == NULL)
  		err(FOPERR);
  	eov = 0;
  }