usr.bin/make More PR bug fixes from FreeBSD

Max Okumoto okumoto at ucsd.edu
Wed Nov 24 04:39:31 PST 2004


PatchSet 322 Date: 2003/10/02 22:30:30 Author: ru
        o Fix a bug that prevented exists() from finding "foo/",
          "foo/." and "foo/.." when ".PATH: foo" was also given.
          PR: bin/34062

PatchSet 323 Date: 2003/10/03 22:33:39 Author: ru
        o Make the -q option DTRT in the compat mode.
        PR: 48210

PatchSet 324 Date: 2003/10/06 18:37:20 Author: ru
        o Fix a bug in variable parsing code that could cause a
          segfault.
          PR: bin/46203
---------------------
PatchSet 322
Date: 2003/10/02 22:30:30
Author: ru
Log:
Fix a bug that prevented exists() from finding "foo/", "foo/."
and "foo/.." when ".PATH: foo" was also given.

PR:		bin/34062

Members: 
	dir.c:1.31->1.32 

Index: dir.c
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/dir.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- dir.c	14 Sep 2003 12:31:33 -0000	1.31
+++ dir.c	2 Oct 2003 21:30:30 -0000	1.32
@@ -680,7 +680,7 @@
     LstNode       ln;	    /* a list element */
     char          *file;    /* the current filename to check */
     Path          *p;	    /* current path member */
-    char          *cp;	    /* index of first slash, if any */
+    char          *cp;	    /* final component of the name */
     Boolean	  hasSlash; /* true if 'name' contains a / */
     struct stat	  stb;	    /* Buffer for stat, if necessary */
     Hash_Entry	  *entry;   /* Entry for mtimes table */
@@ -767,9 +767,14 @@
 		continue;
 	    }
 	    if (*p1 == '\0' && p2 == cp - 1) {
-		DEBUGF(DIR, ("must be here but isn't -- returing NULL\n"));
 		Lst_Close (path);
-		return ((char *) NULL);
+		if (*cp == '\0' || ISDOT(cp) || ISDOTDOT(cp)) {
+		    DEBUGF(DIR, ("returning %s\n", name));
+		    return (estrdup(name));
+		} else {
+		    DEBUGF(DIR, ("must be here but isn't -- returning NULL\n"));
+		    return ((char *) NULL);
+		}
 	    }
 	}
     }
---------------------
PatchSet 323
Date: 2003/10/03 22:33:39
Author: ru
Log:
Make the -q option DTRT in the compat mode.

PR:	48210

Members: 
	compat.c:1.35->1.36 
	main.c:1.84->1.85 

Index: compat.c
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/compat.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- compat.c	23 Oct 2002 23:16:42 -0000	1.35
+++ compat.c	3 Oct 2003 21:33:39 -0000	1.36
@@ -458,7 +458,7 @@
 	 * to tell him/her "yes".
 	 */
 	if (queryFlag) {
-	    exit (-1);
+	    exit (1);
 	}
 
 	/*
Index: main.c
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/main.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -r1.84 -r1.85
--- main.c	14 Sep 2003 12:31:33 -0000	1.84
+++ main.c	3 Oct 2003 21:33:39 -0000	1.85
@@ -866,6 +866,7 @@
 			 * well as initializing the module.
 			 */
 			Compat_Run(targs);
+			outOfDate = 0;
 		}
 		Lst_Destroy(targs, NOFREE);
 	}
---------------------
PatchSet 324
Date: 2003/10/06 18:37:20
Author: ru
Log:
Fix a bug in variable parsing code that could cause a segfault.

PR:		bin/46203
Submitted by:	Stefan Farfeleder <stefan at xxxxxxxxxxxxxxxx>

Members: 
	var.c:1.43->1.44 

Index: var.c
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/var.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- var.c	18 Sep 2003 03:15:57 -0000	1.43
+++ var.c	6 Oct 2003 17:37:20 -0000	1.44
@@ -843,7 +843,8 @@
  *	The (possibly-modified) value of the variable or var_Error if the
  *	specification is invalid. The length of the specification is
  *	placed in *lengthPtr (for invalid specifications, this is just
- *	2...?).
+ *	2 to skip the '$' and the following letter, or 1 if '$' was the
+ *	last character in the string).
  *	A Boolean in *freePtr telling whether the returned string should
  *	be freed by the caller.
  *
@@ -892,7 +893,10 @@
 
 	v = VarFind (name, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
 	if (v == (Var *)NULL) {
-	    *lengthPtr = 2;
+	    if (str[1] != '\0')
+		*lengthPtr = 2;
+	    else
+		*lengthPtr = 1;
 
 	    if ((ctxt == VAR_CMD) || (ctxt == VAR_GLOBAL)) {
 		/*




More information about the Submit mailing list