From nobody  Tue Feb 10 20:59:56 1998
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id UAA18202;
          Tue, 10 Feb 1998 20:59:56 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199802110459.UAA18202@hub.freebsd.org>
Date: Tue, 10 Feb 1998 20:59:56 -0800 (PST)
From: jason_smethers@bigfoot.com
To: freebsd-gnats-submit@freebsd.org
Subject: bin/cat code cleanup
X-Send-Pr-Version: www-1.0

>Number:         5711
>Category:       bin
>Synopsis:       bin/cat code cleanup
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 10 21:10:04 PST 1998
>Closed-Date:    Wed Jun 28 03:27:38 PDT 2000
>Last-Modified:  Wed Jun 28 03:29:24 PDT 2000
>Originator:     Jason Smethers
>Release:        3.0-Current
>Organization:
>Environment:
FreeBSD p90unix.vipersystems.com 3.0-CURRENT FreeBSD 3.0-CURRENT #1: Sun Feb  8 17:26:35 CST 1998     root@p90unix.vipersystems.com:/usr/src/sys/compile/P90UNIX  i386
>Description:
code cleanup of /usr/cat and man page
>How-To-Repeat:

>Fix:
diff -c -r /usr/src/bin/cat/cat.1 /usr/local/src/bin/cat/cat.1
*** /usr/src/bin/cat/cat.1	Sat Feb 22 08:01:26 1997
--- /usr/local/src/bin/cat/cat.1	Mon Feb  2 18:18:34 1998
***************
*** 13,19 ****
  .\"    notice, this list of conditions and the following disclaimer in the
  .\"    documentation and/or other materials provided with the distribution.
  .\" 3. All advertising materials mentioning features or use of this software
! .\"    must display the following acknowledgement:
  .\"	This product includes software developed by the University of
  .\"	California, Berkeley and its contributors.
  .\" 4. Neither the name of the University nor the names of its contributors
--- 13,19 ----
  .\"    notice, this list of conditions and the following disclaimer in the
  .\"    documentation and/or other materials provided with the distribution.
  .\" 3. All advertising materials mentioning features or use of this software
! .\"    must display the following acknowledgment:
  .\"	This product includes software developed by the University of
  .\"	California, Berkeley and its contributors.
  .\" 4. Neither the name of the University nor the names of its contributors
***************
*** 118,125 ****
  .Sh HISTORY
  A
  .Nm
! command appeared in Version 1 AT&T UNIX. 
  Dennis Ritchie designed and wrote the first man page. 
  It appears to have been
  .Xr cat 1 .
! 
--- 118,134 ----
  .Sh HISTORY
  A
  .Nm
! utility appeared in Version 1 AT&T UNIX. 
  Dennis Ritchie designed and wrote the first man page. 
  It appears to have been
  .Xr cat 1 .
! .Sh STANDARDS
! The
! .Nm cat
! utility is compliant with the
! .St -p1003.2-92
! specification.
! .Pp
! The flags
! .Op Fl benstv
! are extensions to the specification.
diff -c -r /usr/src/bin/cat/cat.c /usr/local/src/bin/cat/cat.c
*** /usr/src/bin/cat/cat.c	Fri Mar 28 09:24:04 1997
--- /usr/local/src/bin/cat/cat.c	Tue Feb  3 17:33:24 1998
***************
*** 63,68 ****
--- 63,69 ----
  int rval;
  char *filename;
  
+ int main __P((int, char *[]));
  void cook_args __P((char *argv[]));
  void cook_buf __P((FILE *));
  void raw_args __P((char *argv[]));
***************
*** 76,82 ****
  	extern int optind;
  	int ch;
  
! 	setlocale(LC_CTYPE, "");
  
  	while ((ch = getopt(argc, argv, "benstuv")) != -1)
  		switch (ch) {
--- 77,83 ----
  	extern int optind;
  	int ch;
  
! 	(void)setlocale(LC_ALL, "");
  
  	while ((ch = getopt(argc, argv, "benstuv")) != -1)
  		switch (ch) {
***************
*** 96,107 ****
  			tflag = vflag = 1;	/* -t implies -v */
  			break;
  		case 'u':
! 			setbuf(stdout, (char *)NULL);
  			break;
  		case 'v':
  			vflag = 1;
  			break;
  		default:
  			(void)fprintf(stderr,
  			    "usage: cat [-benstuv] [-] [file ...]\n");
  			exit(1);
--- 97,109 ----
  			tflag = vflag = 1;	/* -t implies -v */
  			break;
  		case 'u':
! 			setbuf(stdout, NULL);
  			break;
  		case 'v':
  			vflag = 1;
  			break;
  		default:
+ 		case '?':
  			(void)fprintf(stderr,
  			    "usage: cat [-benstuv] [-] [file ...]\n");
  			exit(1);
***************
*** 248,258 ****
  			err(1, "%s", filename);
  		bsize = MAX(sbuf.st_blksize, 1024);
  		if ((buf = malloc((u_int)bsize)) == NULL)
! 			err(1, NULL);
  	}
! 	while ((nr = read(rfd, buf, bsize)) > 0)
  		for (off = 0; nr; nr -= nw, off += nw)
! 			if ((nw = write(wfd, buf + off, nr)) < 0)
  				err(1, "stdout");
  	if (nr < 0) {
  		warn("%s", filename);
--- 250,260 ----
  			err(1, "%s", filename);
  		bsize = MAX(sbuf.st_blksize, 1024);
  		if ((buf = malloc((u_int)bsize)) == NULL)
! 			err(1, "cannot allocate buffer");
  	}
! 	while ((nr = read(rfd, buf, (u_int)bsize)) > 0)
  		for (off = 0; nr; nr -= nw, off += nw)
! 			if ((nw = write(wfd, buf + off, (u_int)nr)) < 0)
  				err(1, "stdout");
  	if (nr < 0) {
  		warn("%s", filename);

>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: freebsd-gnats-submit@FreeBSD.ORG, jason_smethers@bigfoot.com
Cc:  Subject: Re: bin/5711: bin/cat code cleanup
Date: Thu, 12 Feb 1998 02:18:18 +1100

 Review:
 
 >diff -c -r /usr/src/bin/cat/cat.1 /usr/local/src/bin/cat/cat.1
 >*** /usr/src/bin/cat/cat.1	Sat Feb 22 08:01:26 1997
 >--- /usr/local/src/bin/cat/cat.1	Mon Feb  2 18:18:34 1998
 >***************
 >*** 13,19 ****
 >  .\"    notice, this list of conditions and the following disclaimer in the
 >  .\"    documentation and/or other materials provided with the distribution.
 >  .\" 3. All advertising materials mentioning features or use of this software
 >! .\"    must display the following acknowledgement:
 >  .\"	This product includes software developed by the University of
 >  .\"	California, Berkeley and its contributors.
 >  .\" 4. Neither the name of the University nor the names of its contributors
 >--- 13,19 ----
 >  .\"    notice, this list of conditions and the following disclaimer in the
 >  .\"    documentation and/or other materials provided with the distribution.
 >  .\" 3. All advertising materials mentioning features or use of this software
 >! .\"    must display the following acknowledgment:
 >  .\"	This product includes software developed by the University of
 >  .\"	California, Berkeley and its contributors.
 >  .\" 4. Neither the name of the University nor the names of its contributors
 
 Don't "fix" alternative spellings.  "acknowledgment" is used in only
 38 files in /usr/src; "acknowledgement" is used in 5148, mostly in
 vendor (CSRG) copyrights.  Do you really wish to "fix" them all? :-)
 
 >--- 118,134 ----
 >...
 >! .Sh STANDARDS
 >! The
 >! .Nm cat
 >! utility is compliant with the
 >! .St -p1003.2-92
 >! specification.
 >...
 
 "is compliant with" should be "conforms to".
 
 >diff -c -r /usr/src/bin/cat/cat.c /usr/local/src/bin/cat/cat.c
 >*** /usr/src/bin/cat/cat.c	Fri Mar 28 09:24:04 1997
 >--- /usr/local/src/bin/cat/cat.c	Tue Feb  3 17:33:24 1998
 >***************
 >*** 63,68 ****
 >--- 63,69 ----
 >  int rval;
 >  char *filename;
 >  
 >+ int main __P((int, char *[]));
 >  void cook_args __P((char *argv[]));
 >  void cook_buf __P((FILE *));
 >  void raw_args __P((char *argv[]));
 
 Lists of declarations should be ordered.  Ordered lists shall remain
 ordered.
 
 >***************
 >*** 96,107 ****
 >  			tflag = vflag = 1;	/* -t implies -v */
 >  			break;
 >  		case 'u':
 >! 			setbuf(stdout, (char *)NULL);
 >  			break;
 >  		case 'v':
 >  			vflag = 1;
 >  			break;
 >  		default:
 >  			(void)fprintf(stderr,
 >  			    "usage: cat [-benstuv] [-] [file ...]\n");
 >  			exit(1);
 >--- 97,109 ----
 >  			tflag = vflag = 1;	/* -t implies -v */
 >  			break;
 >  		case 'u':
 >! 			setbuf(stdout, NULL);
 >  			break;
 >  		case 'v':
 >  			vflag = 1;
 >  			break;
 >  		default:
 >+ 		case '?':
 >  			(void)fprintf(stderr,
 >  			    "usage: cat [-benstuv] [-] [file ...]\n");
 >  			exit(1);
 
 Removing the cast just weakens K&R support.
 
 >***************
 >*** 248,258 ****
 >  			err(1, "%s", filename);
 >  		bsize = MAX(sbuf.st_blksize, 1024);
 >  		if ((buf = malloc((u_int)bsize)) == NULL)
 >! 			err(1, NULL);
 >  	}
 >! 	while ((nr = read(rfd, buf, bsize)) > 0)
 >  		for (off = 0; nr; nr -= nw, off += nw)
 >! 			if ((nw = write(wfd, buf + off, nr)) < 0)
 >  				err(1, "stdout");
 >  	if (nr < 0) {
 >  		warn("%s", filename);
 >--- 250,260 ----
 >  			err(1, "%s", filename);
 >  		bsize = MAX(sbuf.st_blksize, 1024);
 >  		if ((buf = malloc((u_int)bsize)) == NULL)
 >! 			err(1, "cannot allocate buffer");
 >  	}
 >! 	while ((nr = read(rfd, buf, (u_int)bsize)) > 0)
 >  		for (off = 0; nr; nr -= nw, off += nw)
 >! 			if ((nw = write(wfd, buf + off, (u_int)nr)) < 0)
 >  				err(1, "stdout");
 >  	if (nr < 0) {
 >  		warn("%s", filename);
 >
 
 Don't add bogus casts. write()'s third arg has type size_t, not necessarily
 u_int.  Don't cast at all if possible; use variables with the correct type
 instead.  Here a complete cleanup requires at least:
 
 (1) overflow handling for `bsize = MAX(sbuf.st_blksize, 1024);'.  st_blksize
     has type u_int32_t for stat() and int32_t for ostat().  bsize should
     have type size_t and (to avoid bloat to handle portability problems)
     value <= SSIZE_T_MAX and (to avoid using a non-power-of 2 size) a value
     normally somewhat less than SSIZE_T_MAX.  A simple implementation of
     this:
 
 	size_t bsize;
 	...
 	bsize = MIN(sbuf.st_blksize, SSIZE_T_MAX);
 	if (bsize != sbuf.st_blksize) {
 		/*
 		 * This shouldn't happen in practice, so don't bother
 		 * finding the largest power of 2 <= SSIZE_T_MAX.
 		 */
 		assert(SSIZE_T_MAX >= 32767);
 		bsize = 16384;
 	}
 	/*
 	 * Don't increase bsize to 1024 if sbuf.s_blksize < 1024, as in
 	 * the original version.  The system should know better than us
 	 * whether a small size is best.
 	 */
 
 2) Declare variables with the correct types.  Since bsize < SSIZE_T_MAX,
    we don't have to worry about read() or write() returning < 0 for a
    non-error.
 
 	ssize_t nr, nw, off;
 
 3) We still need to cast nr (to (size_t)) in the write() call to avoid
    compiler warnings.  The compiler can't be expected to know that nr >= 0,
    since it can't be expected to know that write() returns a value less
    than the amount requsted (modulo overflow problems which can't happen
    here because bsize <= SSIZE_T_MAX), allthough it could know that the
    initial nr is >= 0.  Assigning nr to a variable with type size_t just
    to avoid the cast would be worse than casting it.
 
 4) Fix a non-cosmetic bug while we're here.  bsize is static; it is
    computed for the first call to raw_cat() and may be pessimal
    or wrong (too small for a raw device) for subsequent calls.
    See mv/mv.c:fastcopy() for fixes for this.  Don't copy too much
    from there.  Type mismatches aren't handled there, and only regular
    files are supported (short writes can be treated as errors since they
    can't happen for regular files).
 
 Bruce

From: "Jason" <jason_smethers@bigfoot.com>
To: <bug-followup@FreeBSD.ORG>
Cc:  Subject: Re: bin/5711
Date: Fri, 13 Feb 1998 20:12:30 -0600

 new diffs:
 
 
 diff -c -r /usr/src/bin/cat/cat.1 /usr/local/src/bin/cat/cat.1
 *** /usr/src/bin/cat/cat.1 Sat Feb 22 08:01:26 1997
 --- /usr/local/src/bin/cat/cat.1 Fri Feb 13 19:48:29 1998
 ***************
 *** 118,125 ****
   .Sh HISTORY
   A
   .Nm
 ! command appeared in Version 1 AT&T UNIX. 
   Dennis Ritchie designed and wrote the first man page. 
   It appears to have been
   .Xr cat 1 .
 ! 
 --- 118,134 ----
   .Sh HISTORY
   A
   .Nm
 ! utility appeared in Version 1 AT&T UNIX. 
   Dennis Ritchie designed and wrote the first man page. 
   It appears to have been
   .Xr cat 1 .
 ! .Sh STANDARDS
 ! The
 ! .Nm cat
 ! utility is expected to conform to the
 ! .St -p1003.2-92
 ! specification.
 ! .Pp
 ! The flags
 ! .Op Fl benstv
 ! are extensions to the specification.
 diff -c -r /usr/src/bin/cat/cat.c /usr/local/src/bin/cat/cat.c
 *** /usr/src/bin/cat/cat.c Fri Mar 28 09:24:04 1997
 --- /usr/local/src/bin/cat/cat.c Fri Feb 13 19:52:55 1998
 ***************
 *** 49,54 ****
 --- 49,55 ----
   #include <sys/param.h>
   #include <sys/stat.h>
   
 + #include <assert.h>
   #include <ctype.h>
   #include <err.h>
   #include <errno.h>
 ***************
 *** 63,72 ****
   int rval;
   char *filename;
   
 ! void cook_args __P((char *argv[]));
 ! void cook_buf __P((FILE *));
 ! void raw_args __P((char *argv[]));
 ! void raw_cat __P((int));
   
   int
   main(argc, argv)
 --- 64,74 ----
   int rval;
   char *filename;
   
 ! void cook_args __P((char *argv[]));
 ! void cook_buf __P((FILE *));
 ! void raw_args __P((char *argv[]));
 ! void raw_cat __P((int));
 ! int main __P((int, char *[]));
   
   int
   main(argc, argv)
 ***************
 *** 76,82 ****
    extern int optind;
    int ch;
   
 !  setlocale(LC_CTYPE, "");
   
    while ((ch = getopt(argc, argv, "benstuv")) != -1)
     switch (ch) {
 --- 78,84 ----
    extern int optind;
    int ch;
   
 !  setlocale(LC_ALL, "");
   
    while ((ch = getopt(argc, argv, "benstuv")) != -1)
     switch (ch) {
 ***************
 *** 237,258 ****
   raw_cat(rfd)
    register int rfd;
   {
 !  register int nr, nw, off, wfd;
 !  static int bsize;
    static char *buf;
    struct stat sbuf;
   
    wfd = fileno(stdout);
 !  if (buf == NULL) {
 !   if (fstat(wfd, &sbuf))
 !    err(1, "%s", filename);
 !   bsize = MAX(sbuf.st_blksize, 1024);
 !   if ((buf = malloc((u_int)bsize)) == NULL)
 !    err(1, NULL);
    }
    while ((nr = read(rfd, buf, bsize)) > 0)
     for (off = 0; nr; nr -= nw, off += nw)
 !    if ((nw = write(wfd, buf + off, nr)) < 0)
       err(1, "stdout");
    if (nr < 0) {
     warn("%s", filename);
 --- 239,269 ----
   raw_cat(rfd)
    register int rfd;
   {
 !  register int wfd = 0;
    static char *buf;
    struct stat sbuf;
 +  static size_t bsize;
 +  size_t nr, nw, off;
   
    wfd = fileno(stdout);
 !  if (fstat(wfd, &sbuf))
 !   err(1, "%s", filename);
 !  if (bsize < sbuf.st_blksize) {
 !   bsize = MIN(sbuf.st_blksize, SSIZE_MAX);
 !   if (bsize != sbuf.st_blksize) {
 !    assert(SSIZE_MAX >= 32767);
 !    bsize = 16384;
 !   }
 !   if (buf != NULL)
 !    free(buf);
 !   if ((buf = malloc(bsize)) == NULL) {
 !    bsize = 0;
 !    err(1, "malloc failed: cannot allocate buffer");
 !   }
    }
    while ((nr = read(rfd, buf, bsize)) > 0)
     for (off = 0; nr; nr -= nw, off += nw)
 !    if ((nw = write(wfd, buf + off, (size_t)nr)) < 0)
       err(1, "stdout");
    if (nr < 0) {
     warn("%s", filename);
 
 

From: "Jason" <jason_smethers@bigfoot.com>
To: <bug-followup@FreeBSD.ORG>
Cc:  Subject: Re: bin/5711
Date: Sun, 8 Mar 1998 18:04:28 -0600

 final diffs?
 
 
 
 begin 666 bin.cat.diff
 M9&EF9B M8R M<B O=7-R+W-R8R]B:6XO8V%T+V-A="XQ("]U<W(O;&]C86PO
 M<W)C+V)I;B]C870O8V%T+C$**BHJ("]U<W(O<W)C+V)I;B]C870O8V%T+C$)
 M4V%T($9E8B R,B P.#HP,3HR-B Q.3DW"BTM+2 O=7-R+VQO8V%L+W-R8R]B
 M:6XO8V%T+V-A="XQ"49R:2!&96(@,3,@,3DZ-#@Z,CD@,3DY. HJ*BHJ*BHJ
 M*BHJ*BHJ*BH**BHJ(#$Q."PQ,C4@*BHJ*@H@("Y3:"!(25-43U)9"B @00H@
 M("Y.;0HA(&-O;6UA;F0@87!P96%R960@:6X@5F5R<VEO;B Q($%4)E0@54Y)
 M6"X@"B @1&5N;FES(%)I=&-H:64@9&5S:6=N960@86YD('=R;W1E('1H92!F
 M:7)S="!M86X@<&%G92X@"B @270@87!P96%R<R!T;R!H879E(&)E96X*(" N
 M6'(@8V%T(#$@+@HA( HM+2T@,3$X+#$S-" M+2TM"B @+E-H($A)4U1/4ED*
 M("!!"B @+DYM"B$@=71I;&ET>2!A<'!E87)E9"!I;B!697)S:6]N(#$@050F
 M5"!53DE8+B *("!$96YN:7,@4FET8VAI92!D97-I9VYE9"!A;F0@=W)O=&4@
 M=&AE(&9I<G-T(&UA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G5F.PHK( ES=&%T:6,@<VEZ95]T(&)S:7IE.PHK( ES
 M<VEZ95]T(&YR+"!N=RP@;V9F.PH@( H@( EW9F0@/2!F:6QE;F\H<W1D;W5T
 M*3L*(2 ):68@*&9S=&%T*'=F9"P@)G-B=68I*0HA( D)97)R*#$L("(E<R(L
 M(&9I;&5N86UE*3L*(2 ):68@*&)S:7IE(#P@<V)U9BYS=%]B;&MS:7IE*2![
 M"B$@"0EB<VEZ92 ]($U)3BAS8G5F+G-T7V)L:W-I>F4L(%-325I%7TU!6"D[
 M"B$@"0EI9B H8G-I>F4@(3T@<V)U9BYS=%]B;&MS:7IE*2!["B$@"0D)8G-I
 M>F4@/2 Q-C,X-#L*(2 )"7T*(2 )"6EF*&)U9B A/2!.54Q,*0HA( D)"69R
 M964H8G5F*3L*(2 )"6EF("@H8G5F(#T@;6%L;&]C*&)S:7IE*2D@/3T@3E5,
 M3"D@>PHA( D)"6)S:7IE(#T@,#L*(2 )"0EE<G(H,2P@(FUA;&QO8R!F86EL
 M960Z(&-A;FYO="!A;&QO8V%T92!B=69F97(B*3L*(2 )"7T*(" )?0H@( EW
 M:&EL92 H*&YR(#T@<F5A9"AR9F0L(&)U9BP@8G-I>F4I*2 ^(# I"B @"0EF
 M;W(@*&]F9B ](# [(&YR.R!N<B M/2!N=RP@;V9F("L](&YW*0HA( D)"6EF
 M("@H;G<@/2!W<FET92AW9F0L(&)U9B K(&]F9BP@*'-I>F5?="EN<BDI(#P@
 M,"D*(" )"0D)97)R*#$L(")S=&1O=70B*3L*(" ):68@*&YR(#P@,"D@>PH@
 9( D)=V%R;B@B)7,B+"!F:6QE;F%M92D["@``
 `
 end
 

From: "Jason" <jes@hal-pc.org>
To: <bug-followup@freebsd.org>
Cc:  Subject: Re: bin/5711
Date: Mon, 11 May 1998 21:46:47 -0500

 This is a follow up that takes into account cosmetic changes made to
 cat since the last patch was send. I'm sorry about having to send
 UUendcode, but its the only way I can currently get it out vi email
 without garrbling the white space.
 
 Alternativly you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="!A;&QO8V%T92!B=69F97(B*3L*(2 )"7T*(" )?0H@( EW:&EL92 H*&YR
 M(#T@<F5A9"AR9F0L(&)U9BP@8G-I>F4I*2 ^(# I"B @"0EF;W(@*&]F9B ]
 M(# [(&YR.R!N<B M/2!N=RP@;V9F("L](&YW*0HA( D)"6EF("@H;G<@/2!W
 M<FET92AW9F0L(&)U9B K(&]F9BP@*'-I>F5?="EN<BDI(#P@,"D*(" )"0D)
 M97)R*#$L(")S=&1O=70B*3L*(" ):68@*&YR(#P@,"D@>PH@( D)=V%R;B@B
 0)7,B+"!F:6QE;F%M92D["@``
 `
 end
 

From: "Jason" <jes@hal-pc.org>
To: <bug-followup@freebsd.org>
Cc:  Subject: Re: bin/5711
Date: Mon, 27 Jul 1998 17:45:12 -0500

 Fixed the style nits I think.
 
 Overview:
 
 Added prototype for main()
 Use correct types in the function raw_cat.
 Optimize for I/O.
 
 Since last submission:
 Ordered lists.
 Staticized wfd in raw_cat so stdout is assigned and fstat'ed only once.
 
 patch: http://www.hal-pc.org/~jes/FreeBSD/cat.diff
 
 -Jason
 

From: Guy Helmer <ghelmer@cs.iastate.edu>
To: freebsd-gnats-submit@freebsd.org, jason_smethers@bigfoot.com
Cc:  
Subject: Re: bin/5711: bin/cat code cleanup
Date: Thu, 03 Jun 1999 20:54:40 -0500

 The location mentioned (http://www.hal-pc.org/~jes/FreeBSD/cat.diff) no
 longer seems to work.  Are your latest patches available anywhere?
 
 Guy Helmer
 ghelmer@freebsd.org
 
State-Changed-From-To: open->closed 
State-Changed-By: nbm 
State-Changed-When: Wed Jun 28 03:27:38 PDT 2000 
State-Changed-Why:  
Feedback timeout.  Since then, at least one sync with OpenBSD's cat was 
performed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=5711 
>Unformatted:
