[net.bugs.4bsd] 4.3 BSD "rcsdiff -c1" fails

lepreau@utah-cs.UUCP (Jay Lepreau) (08/07/86)

Index: 	new/rcs/src/rcsdiff.c 4.3BSD FIX

Description:
	+  * I broke -c<number> in last rev.
	+  * Also, mixing a bopt with an otheropt was broken.

Repeat-By:
	rcsdiff -c1 foo.c

Fix:
*** /tmp/,RCSt1003033	Thu Aug  7 01:49:55 1986
--- rcsdiff.c	Wed Jun 18 15:04:56 1986
***************
*** 4,6 ****
   static char rcsid[]=
!  "$Header: rcsdiff.c,v 3.7 86/05/19 02:36:16 lepreau Exp $ Purdue CS";
  /*****************************************************************************
--- 4,6 ----
   static char rcsid[]=
!  "$Header: rcsdiff.c,v 3.8 86/06/18 15:02:32 lepreau Exp $ Purdue CS";
  /*****************************************************************************
***************
*** 22,23 ****
--- 22,27 ----
  /* $Log:	rcsdiff.c,v $
+  * Revision 3.8  86/06/18  15:02:32  lepreau
+  * I broke -c<number> in last rev.
+  * Also, mixing a bopt with an otheropt was broken.
+  * 
   * Revision 3.7  86/05/19  02:36:16  lepreau
***************
*** 24,26 ****
   * Pass on new diff options, and allow them to be clustered.
-  * This was 4.3 release (oops).
   * 
--- 28,29 ----
***************
*** 45,46 ****
--- 48,50 ----
   */
+ #include <ctype.h>
  #include "rcsbase.h"
***************
*** 59,60 ****
--- 63,65 ----
  char bops[10] = "-";
+ char otherops[10] = "-";
  
***************
*** 78,80 ****
          catchints();
!         otheroption="";
  	boption = bops + 1;
--- 83,85 ----
          catchints();
!         otheroption = otherops + 1;
  	boption = bops + 1;
***************
*** 109,112 ****
                  case 'n':
!                         if (*otheroption=='\0') {
!                                 otheroption= argp-2;
                          } else {
--- 114,124 ----
                  case 'n':
!                         if (otheroption == otherops + 1) {
! 				*otheroption++ = c;
! 				if (c == 'c' && isdigit(*argp)) {
! 					while (isdigit(*argp))
! 						*otheroption++ = *argp++;
! 					if (*argp)
! 						faterror("-c: bad count");
! 					argp = "";
! 				}
                          } else {
***************
*** 120,122 ****
  	if (boption != bops + 1) {
! 	    *boption = ' ';
  	    boption = bops;
--- 132,134 ----
  	if (boption != bops + 1) {
!  	    *boption = ' ';
  	    boption = bops;
***************
*** 123,124 ****
--- 135,140 ----
  	}
+ 	if (otheroption != otherops + 1) {
+  	    *otheroption = ' ';
+ 	    otheroption = otherops;
+ 	}
          if (argc<1) faterror("No input file\n%s",cmdusage);
***************
*** 169,171 ****
                          temp2file=workfilename;
!                         diagnose("diff %s%s -r%s %s",boption,otheroption,xrev1,workfilename);
                  } else {
--- 185,187 ----
                          temp2file=workfilename;
!                         diagnose("diff %s%s-r%s %s",boption,otheroption,xrev1,workfilename);
                  } else {
***************
*** 179,183 ****
                          }
!                         diagnose("diff %s%s -r%s -r%s",boption,otheroption,xrev1,xrev2);
                  }
!                 sprintf(command,"%s %s %s %s %s\n",DIFF,boption,
                          otheroption, temp1file, temp2file);
--- 195,199 ----
                          }
!                         diagnose("diff %s%s-r%s -r%s",boption,otheroption,xrev1,xrev2);
                  }
!                 sprintf(command,"%s %s%s%s %s\n",DIFF,boption,
                          otheroption, temp1file, temp2file);