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

看板DFBSD_submit作者時間21年前 (2004/11/17 21:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
This is a multi-part message in MIME format. --------------070001040106070603080708 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Taken from FreeBSD 2001/04/25 15:22:38 Author: ru Log: Make ${.OBJDIR} canonical. --------------070001040106070603080708 Content-Type: text/plain; name="patch-4.195" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-4.195" --------------------- 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; --------------070001040106070603080708--
文章代碼(AID): #11crC000 (DFBSD_submit)