SHAPE - Official Patch (PATCH#3)

Wolfgang Obst wolfgang at coma.UUCP
Tue Aug 22 02:09:09 AEST 1989



Here are the second official patches for the shape-toolkit.
The shell archive below conatins 3 files:

		sh_3.11.pat5
		sh_3.11.pat6
		vc_3.31.pat2

Apply the patches sh_3.11.pat{5,6} within the subdirectory
.../src/shape, the patches vc_3.31.pat2 within the subdirectory
.../src/vc using the patch(1) command.

Keep on shapin'
-Wolfgang

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Wolfgang Obst  					TU Berlin FB-20 Sekr. FR 5-6
UUCP: {unido!}coma!wolfgang			Franklinstr. 28/29
BITNET: wolfgang at db0tui62		 	D-1000 Berlin (West) 10
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------- CUT HER -----------------------------------

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	SHAPE.PATCH.3
#	sh_3.11.pat5
#	sh_3.11.pat6
#	vc_3.31.pat2
# This archive created: Mon Aug 21 16:51:50 1989
export PATH; PATH=/bin:/usr/bin:$PATH
if test -f 'SHAPE.PATCH.3'
then
	echo shar: "will not over-write existing file 'SHAPE.PATCH.3'"
else
cat << \SHAR_EOF > 'SHAPE.PATCH.3'

SHAR_EOF
fi
if test -f 'sh_3.11.pat5'
then
	echo shar: "will not over-write existing file 'sh_3.11.pat5'"
else
cat << \SHAR_EOF > 'sh_3.11.pat5'
*** rule.c	Thu Aug 10 11:55:58 1989
--- rule.c.new	Thu Aug 10 11:56:12 1989
***************
*** 300,305 ****
--- 300,306 ----
    int jjj = 0;
    int kkk = 0;
    int xx = 0;
+   int xx2;
    int ss = 0;
    int minus = 0;
    Bool src_found = FALSE;
***************
*** 362,367 ****
--- 363,370 ----
  	    {
  	      if((current = ruletab[hasht] = (struct rules *) malloc( sizeof(struct rules))) == (struct rules *)NIL)
  		errexit(10,"malloc");
+ 	      for(xx2 = 0; xx2 < MAXDEPS; xx2++)
+ 		current->deplist[xx2] = NIL;
  	    }
  	  else
  	  {
***************
*** 423,428 ****
--- 426,433 ----
  	      {
  		if((current = current->nextrule = (struct rules *) malloc( sizeof(struct rules))) == (struct rules *)NIL)
  		  errexit(10,"malloc");
+ 		for(xx2 = 0; xx2 < MAXDEPS; xx2++)
+ 		  current->deplist[xx2] = NIL;
  	      }
  	  }
  	}
***************
*** 430,435 ****
--- 435,442 ----
  	{
  	  if((current = stdruletab[lastrule] = (struct rules *) malloc( sizeof(struct rules))) == (struct rules *) NIL)
  	    errexit(10,"malloc");
+ 	  for(xx2 = 0; xx2 < MAXDEPS; xx2++)
+ 	    current->deplist[xx2] = NIL;
  	  overload_stdrule();
  	  implicit_suffs[lastrule] = lastrule;
  	  lastrule++;
*** version.c	Thu Aug 10 12:00:20 1989
--- version.c.new	Thu Aug 10 12:01:39 1989
***************
*** 24,27 ****
   * 		     Tel: +49-30-314-22972
   * 		     E-mail: shape at coma.uucp or shape at db0tui62.bitnet
   */
! char *version () { static char ConfID[] =  "3.11 Patchlevel_4\n\tFri Jul 21 17:35:35 MET DST 1989 by wolfgang at coma ";  return ConfID; }
--- 24,27 ----
   * 		     Tel: +49-30-314-22972
   * 		     E-mail: shape at coma.uucp or shape at db0tui62.bitnet
   */
! char *version () { static char ConfID[] =  "3.11 Patchlevel_5\n\tThu Aug 10 12:01:08 MET DST 1989 by wolfgang at coma ";  return ConfID; }
SHAR_EOF
fi
if test -f 'sh_3.11.pat6'
then
	echo shar: "will not over-write existing file 'sh_3.11.pat6'"
else
cat << \SHAR_EOF > 'sh_3.11.pat6'
Only in /u/shape/shapetools/src/shape: Makefile
Only in /u/shape/shapetools/src/shape: Makefile.distribution
Only in /u/shape/shapetools/src/shape: PATCH
Only in /u/shape/shapetools/src/shape: attr.c.orig
diff -c /u/shape/shapetools/src/shape/inherit.c ./inherit.c
*** /u/shape/shapetools/src/shape/inherit.c	Mon Feb 27 17:17:03 1989
--- ./inherit.c	Fri Aug 18 15:27:18 1989
***************
*** 288,294 ****
      else
      (void) sprintf(attr,"%sversion=%d.%d",attr,AF_BUSYVERS,AF_BUSYVERS); */
    (void) strcat(attr, longattrs[depth]);
!   (void) strcpy(longattrs[depth],attr);
    return(attr);
  }
  
--- 288,298 ----
      else
      (void) sprintf(attr,"%sversion=%d.%d",attr,AF_BUSYVERS,AF_BUSYVERS); */
    (void) strcat(attr, longattrs[depth]);
!   free(longattrs[depth]);
!   if((longattrs[depth] = malloc((unsigned) strlen(attr) +
! 				sizeof(char))) == NIL)
!     errexit(10,"malloc");
!     (void) strcpy(longattrs[depth],attr);
    return(attr);
  }
  
diff -c /u/shape/shapetools/src/shape/macro.c ./macro.c
*** /u/shape/shapetools/src/shape/macro.c	Wed Mar 15 17:01:45 1989
--- ./macro.c	Fri Aug 18 17:14:15 1989
***************
*** 30,108 ****
  #ifndef lint
  static char *ConfFlg = CFFLGS;	/* should be defined from within Makefile */
  #endif
- /*
-  * $Log:	macro.c,v $
-  * Revision 3.2  89/02/20  16:25:49  wolfgang
-  * NET-RELEASE
-  * 
-  * Revision 3.1  89/02/08  12:45:34  wolfgang
-  * performance improved.
-  * 
-  * Revision 3.0  89/01/24  11:35:54  wolfgang
-  * New System Generation
-  * 
-  * Revision 2.19  89/01/03  13:11:05  wolfgang
-  * changes done for lint
-  * 
-  * Revision 2.18  88/12/21  15:03:44  wolfgang
-  * changes done for lint
-  * 
-  * Revision 2.17  88/12/15  16:16:23  wolfgang
-  * bug fixed in get_macros (segmantation violation on sissy (SUN))
-  * 
-  * Revision 2.16  88/11/21  20:56:56  wolfgang
-  * changes done for sun
-  * 
-  * Revision 2.15  88/11/18  15:01:18  wolfgang
-  * bug fixed: ::= indicates no longer a macrodef.
-  * 
-  * Revision 2.14  88/11/04  16:41:58  wolfgang
-  * variant macros no are accumulated.
-  * 
-  * Revision 2.13  88/10/27  16:37:40  wolfgang
-  * bugs fixed (new variant handling).
-  * 
-  * Revision 2.12  88/10/20  13:20:56  wolfgang
-  * bug fixed in get_variant_macro.
-  * 
-  * Revision 2.11  88/10/18  17:41:12  wolfgang
-  * new handling for variants implemented. macro expansion changed.
-  * 
-  * Revision 2.10  88/10/14  17:14:10  wolfgang
-  * new procedure: get_variant_macro added and changes don for new
-  * handling of variants.
-  * 
-  * Revision 2.9  88/10/13  12:03:24  wolfgang
-  * handle_comments changed: white space is now required after #%.
-  * 
-  * Revision 2.8  88/09/16  13:30:57  wolfgang
-  * getlin changed. In continuation lines one leading TAB is now suppressd.
-  * 
-  * Revision 2.7  88/09/09  11:40:31  wolfgang
-  * little bug fixed.
-  * 
-  * Revision 2.6  88/09/08  11:57:51  wolfgang
-  * handle_comments(line) improved: # are allowed in quotes.
-  * 
-  * Revision 2.5  88/09/08  11:48:29  wolfgang
-  * handle_comments improved: kills commenmts if there are no quotes.
-  * 
-  * Revision 2.4  88/09/08  10:32:55  wolfgang
-  * handle_comments(line) added. Now comments are allowed in rule- and
-  * variant-section, respectively.
-  * 
-  * Revision 2.3  88/09/07  11:22:38  wolfgang
-  * get_macros changed; the files are copied into a tmp file which is
-  * the input file for yylex.
-  * 
-  * Revision 2.2  88/08/23  16:33:21  wolfgang
-  * In dump() now \t is supressed for generating confid's (im macrodefinitions
-  * \t is not allowed as first char.
-  * 
-  * Revision 2.1  88/08/19  10:17:33  wolfgang
-  * This version is part of a release
-  * 
-  */
  
  #include <stdio.h>
  #include <sys/types.h>
--- 30,35 ----
***************
*** 118,124 ****
  char *template = "/tmp/shapeXXXXXX";
  FILE *temp;
  
- 
  char *curvpath[8] = {NIL,NIL,NIL,NIL,NIL,NIL,NIL,NIL};
  char *errstring;
  int macdepth;
--- 45,50 ----
***************
*** 145,150 ****
--- 71,77 ----
    char line[MAXLINELENGTH];
    char line2[MAXLINELENGTH];
    int len = 0;
+   int off;
    while (fgets(line, MAXLINELENGTH, file))   /* getc ?????  */
      {
        len = strlen(line);
***************
*** 154,160 ****
  	  line[len-1] = '\0';
  	  (void) fgets(line2, MAXLINELENGTH, file);
  	  if(line2[0] == '\t')
! 	    (void) strcat(line,&line2[1]);
  	  else
  	    (void) strcat(line,line2);
  	  len = strlen(line);
--- 81,92 ----
  	  line[len-1] = '\0';
  	  (void) fgets(line2, MAXLINELENGTH, file);
  	  if(line2[0] == '\t')
! 	    {
! 	      off = 0;
! 	      while((line2[off] == '\t') || (line2[off] == ' '))
! 		off++;
! 	      (void) strcat(line,&line2[off]);
! 	    }
  	  else
  	    (void) strcat(line,line2);
  	  len = strlen(line);
***************
*** 226,237 ****
    if (!line)
      return;
  
-   if ((name = malloc(MACRONAM)) == NIL)
-     errexit(10,"malloc");
-   if((value = malloc(MACROVAL)) == NIL)
-     errexit(10,"malloc");
    if((line2 = malloc(MAXLINELENGTH)) == NIL)
      errexit(10,"malloc");
    if (*line != '\t')
      {
        p1 = index(line,'=');
--- 158,166 ----
    if (!line)
      return;
  
    if((line2 = malloc(MAXLINELENGTH)) == NIL)
      errexit(10,"malloc");
+ 
    if (*line != '\t')
      {
        p1 = index(line,'=');
***************
*** 256,264 ****
  	  value = p1;
  	  if (strcmp(name,IMPORT) != 0)
  	    {
- #ifdef DEBUG_MACRO
- printf("name=#%s#\nvalue=#%s#\n\n", name, value);
- #endif DEBUG_MACRO
  	      hashv = hashval(name);
  	      addhash(hashv,name,value);
                if (strcmp(name,"VPATH") == 0)
--- 185,190 ----
***************
*** 286,294 ****
  	    }
  	}
      }
-   free(name);
    free(line2);
!   free(value);
  }
  
  char *expandmacro(inpstring)
--- 212,219 ----
  	    }
  	}
      }
    free(line2);
! 
  }
  
  char *expandmacro(inpstring)
***************
*** 306,315 ****
  char *start;
  char newstr[MAXLINELENGTH];
  char *string;
! char *mist;
  char *variant_macro = NIL;
  Bool dollar;
  dollar = FALSE;
  if (macdepth == 0)
      errstring = inpstring;
  
--- 231,241 ----
  char *start;
  char newstr[MAXLINELENGTH];
  char *string;
! char mist[2048];
  char *variant_macro = NIL;
  Bool dollar;
  dollar = FALSE;
+ 
  if (macdepth == 0)
      errstring = inpstring;
  
***************
*** 318,326 ****
--- 244,256 ----
  if (macdepth == 50)
    errexit(25, errstring);
  
+ if(index(inpstring,'$') == NIL)
+   return(inpstring);
+ 
  newstr[0] = '\0';
  if ((string = malloc((unsigned) (strlen(inpstring) + sizeof(char)))) == NIL)
    errexit(10,"malloc");
+ 
  (void) strcpy(string,inpstring);
  p = string;
  
***************
*** 332,337 ****
--- 262,268 ----
  	  {
  	    list[ii] = p;
  	    ii++;
+ 	    list[ii] = NIL;
  	    dollar = FALSE;
  	  }
    	if (ii > 100)
***************
*** 385,395 ****
  		variant_macro = get_variant_macro(name);
  		if (strcmp(variant_macro,BLUMENKOHL))
  		  {
! 		    mist = expandmacro(variant_macro);
  		    if ((list[ii] =
  			 malloc((unsigned)
  				(strlen(mist) + sizeof(char)))) == NIL)
  		      errexit(10,"malloc");
  		    (void) strcpy(list[ii],mist);
  		    ii++;
  		    if (ii > 100)
--- 316,327 ----
  		variant_macro = get_variant_macro(name);
  		if (strcmp(variant_macro,BLUMENKOHL))
  		  {
! 		    (void) strcpy(mist,expandmacro(variant_macro));
  		    if ((list[ii] =
  			 malloc((unsigned)
  				(strlen(mist) + sizeof(char)))) == NIL)
  		      errexit(10,"malloc");
+ 		    list[ii+1] = NIL;
  		    (void) strcpy(list[ii],mist);
  		    ii++;
  		    if (ii > 100)
***************
*** 408,418 ****
  		    
  		    if ((strcmp(current->name, name) == 0))
  		      {
! 			mist = expandmacro(current->entry);
  			if ((list[ii] =
  			     malloc((unsigned) 
  				    (strlen(mist) + sizeof(char)))) == NIL)
  			  errexit(10,"malloc");
  			(void) strcpy(list[ii],mist);
  			ii++;
  			if (ii > 100)
--- 340,351 ----
  		    
  		    if ((strcmp(current->name, name) == 0))
  		      {
! 			(void) strcpy(mist,expandmacro(current->entry));
  			if ((list[ii] =
  			     malloc((unsigned) 
  				    (strlen(mist) + sizeof(char)))) == NIL)
  			  errexit(10,"malloc");
+ 			list[ii+1] = NIL;
  			(void) strcpy(list[ii],mist);
  			ii++;
  			if (ii > 100)
***************
*** 424,430 ****
        }
    }
  for (j = 0; j < ii; j++)
!      (void) strcat(newstr,list[j]);
  macdepth = 0;
  return newstr;
  } /*end expandmacro */
--- 357,366 ----
        }
    }
  for (j = 0; j < ii; j++)
! {
!   (void) strcat(newstr,list[j]);
! }
! free(string);
  macdepth = 0;
  return newstr;
  } /*end expandmacro */
Only in /u/shape/shapetools/src/shape: macro.c.orig
diff -c /u/shape/shapetools/src/shape/main.c ./main.c
*** /u/shape/shapetools/src/shape/main.c	Mon Feb 27 17:17:01 1989
--- ./main.c	Fri Aug 18 16:05:45 1989
***************
*** 187,193 ****
  #ifdef MEMDEBUG
  memprot = fopen ("memprot", "w");
  #endif
- 
  rebuildflg = FALSE;
  bpoolflg = TRUE;
  
--- 187,192 ----
Only in /u/shape/shapetools/src/shape: misc.c.orig
diff -c /u/shape/shapetools/src/shape/produce.c ./produce.c
*** /u/shape/shapetools/src/shape/produce.c	Fri Jun 30 12:03:00 1989
--- ./produce.c	Fri Aug 18 15:27:35 1989
***************
*** 1116,1126 ****
    Bool ignflg = FALSE;
    char *rc;
    Bool silflg;
! 
    cmd = repl_string(cmd);
    
    silflg = silentflg;
! 
    while((cmd[0] == '\t') || (cmd[0] == ' ') || (cmd[0] == '\n'))
      *cmd++;
  
--- 1116,1128 ----
    Bool ignflg = FALSE;
    char *rc;
    Bool silflg;
!   char *free_cmd_ptr;
!   char *old_cmd;
!   old_cmd = cmd;
    cmd = repl_string(cmd);
    
    silflg = silentflg;
!   free_cmd_ptr = cmd;
    while((cmd[0] == '\t') || (cmd[0] == ' ') || (cmd[0] == '\n'))
      *cmd++;
  
***************
*** 1170,1176 ****
  	    }
  	}
      }
!   free(cmd);
  }
  
  
--- 1172,1179 ----
  	    }
  	}
      }
!   if(old_cmd != free_cmd_ptr)
!     free(free_cmd_ptr);
  }
  
  
Only in /u/shape/shapetools/src/shape: produce.c.orig
Only in /u/shape/shapetools/src/shape: rule.c.orig
Only in /u/shape/shapetools/src/shape: shape.l.orig
Only in .: shape.sh
diff -c /u/shape/shapetools/src/shape/std.c ./std.c
*** /u/shape/shapetools/src/shape/std.c	Mon Feb 27 17:16:50 1989
--- ./std.c	Fri Aug 18 15:27:50 1989
***************
*** 381,387 ****
  	    while (stdrules[i][0] == '\t')
  	      {
  		comm->command = stdrules[i];
! 		if ((comm = comm->nextcmd = (struct cmds *) malloc( sizeof (struct cmds *))) == (struct cmds *) NIL)
  		  errexit(10,"malloc");
  		i++;
  	      }
--- 381,387 ----
  	    while (stdrules[i][0] == '\t')
  	      {
  		comm->command = stdrules[i];
! 		if ((comm = comm->nextcmd = (struct cmds *) malloc( sizeof (struct cmds))) == (struct cmds *) NIL)
  		  errexit(10,"malloc");
  		i++;
  	      }
diff -c /u/shape/shapetools/src/shape/version.c ./version.c
*** /u/shape/shapetools/src/shape/version.c	Thu Aug 10 12:03:41 1989
--- ./version.c	Fri Aug 18 17:20:08 1989
***************
*** 24,27 ****
   * 		     Tel: +49-30-314-22972
   * 		     E-mail: shape at coma.uucp or shape at db0tui62.bitnet
   */
! char *version () { static char ConfID[] =  "3.11 Patchlevel_5\n\tThu Aug 10 12:01:08 MET DST 1989 by wolfgang at coma ";  return ConfID; }
--- 24,27 ----
   * 		     Tel: +49-30-314-22972
   * 		     E-mail: shape at coma.uucp or shape at db0tui62.bitnet
   */
! char *version () { static char ConfID[] =  "3.11 Patchlevel_6\n\tFri Aug 18 17:19:50 MET DST 1989 by wolfgang at coma ";  return ConfID; }
Only in /u/shape/shapetools/src/shape: version.c.orig
Only in .: version.c~
SHAR_EOF
fi
if test -f 'vc_3.31.pat2'
then
	echo shar: "will not over-write existing file 'vc_3.31.pat2'"
else
cat << \SHAR_EOF > 'vc_3.31.pat2'
*** vlmisc.c	Mon Feb 27 17:10:39 1989
--- /tmp/vc/vlmisc.c	Mon Aug 21 11:11:30 1989
***************
*** 148,152 ****
    char *uinfo, *tmp;
    
!   if ((tmp = malloc(MAXNAMLEN + MAXHOSTNAMELEN + 2)) == NULL) {
      fprintf (stderr, "in GetUserInfo: not enough memory\n");
      exit (1);
--- 148,152 ----
    char *uinfo, *tmp;
    
!   if ((tmp = malloc((unsigned) (MAXNAMLEN + MAXHOSTNAMELEN + 2))) == NULL) {
      fprintf (stderr, "in GetUserInfo: not enough memory\n");
      exit (1);
***************
*** 153,157 ****
    }
  
!   if ((uinfo = malloc(20)) == NULL) {
     fprintf (stderr, "in GetUserInfo: not enough memory\n");
      exit (1);
--- 153,157 ----
    }
  
!   if ((uinfo = malloc((unsigned)20)) == NULL) {
     fprintf (stderr, "in GetUserInfo: not enough memory\n");
      exit (1);
***************
*** 283,287 ****
    length += strlen (udas) + 1;	/* plus the new udas */
    length++;
!   if ((cpp = (char **) malloc ((unsigned)(sizeof (char **) * length))) 
        == (char **) NULL) {
      (void)sprintf (error_string, "%s: in AddUdattra(): malloc", Progname);
--- 283,287 ----
    length += strlen (udas) + 1;	/* plus the new udas */
    length++;
!   if ((cpp = (char **) malloc ((unsigned)(sizeof (char *) * length))) 
        == (char **) NULL) {
      (void)sprintf (error_string, "%s: in AddUdattra(): malloc", Progname);
***************
*** 616,621 ****
    }
  
!   files = (char **) NULL;
!   dirs = (char **) NULL;
    
    av = tav;
--- 616,621 ----
    }
  
!   *files = (char *) NULL;
!   *dirs = (char *) NULL;
    
    av = tav;
*** /u/shape/shapetools/src/vc/version.c	Wed Mar 15 17:02:21 1989
--- /tmp/vc/version.c	Mon Aug 21 17:17:12 1989
***************
*** 29,33 ****
   */
  char *version () { 
!   static char ConfID[] =  "3.31 Patchlevel_1\n\tThu Mar  9 22:34:20 MET 1989 by axel at coma)";
    return ConfID;
  }
--- 29,33 ----
   */
  char *version () { 
!   static char ConfID[] =  "3.31 Patchlevel_2\n\tMon Aug 21 17:16:16 MET DST 1989 by uli at coma)";
    return ConfID;
  }
SHAR_EOF
fi
exit 0
#	End of shell archive



More information about the Comp.sources.bugs mailing list