DragonFly BSD
DragonFly submit List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

usr.bin/make Make ${.OBJDIR} canonical using getcwd()


From: Max Okumoto <okumoto@home>
Date: Wed, 17 Nov 2004 05:12:40 -0800

Taken from FreeBSD 2001/04/25 15:22:38
Author: ru
Log:
Make ${.OBJDIR} canonical.
---------------------
PatchSet 195
Date: 2001/04/25 15:22:38
Author: ru
Log:
Make ${.OBJDIR} canonical.

Reviewed by:	bde

Members: 
	main.c:1.47->1.48 

Index: main.c
===================================================================
RCS file: /usr/home/okumoto/Work/make/fbsd-cvs/src/usr.bin/make/main.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- main.c	1 Mar 2001 06:03:17 -0000	1.47
+++ main.c	25 Apr 2001 14:22:38 -0000	1.48
@@ -418,19 +418,11 @@
 	struct stat sb;
 
 	if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) {
-		if (chdir(path)) {
+		if (chdir(path) == -1 || getcwd(obpath, MAXPATHLEN) == NULL) {
 			warn("warning: %s", path);
 			return 0;
 		}
-		else {
-			if (path[0] != '/') {
-				(void) snprintf(obpath, MAXPATHLEN, "%s/%s",
-						curdir, path);
-				return obpath;
-			}
-			else
-				return path;
-		}
+		return obpath;
 	}
 
 	return 0;


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]