Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!nosc!ucsd!rutgers!mailrus!cornell!uw-beaver!ssc-vax!uvicctr!tholm From: tholm@uvicctr.UUCP (Terrence W. Holm) Newsgroups: comp.os.minix Subject: getcwd(3) bug Message-ID: <493@uvicctr.UUCP> Date: 8 Sep 88 19:05:38 GMT Reply-To: tholm@uvicctr.UUCP (Terrence W. Holm) Organization: University of Victoria, Victoria B.C. Canada Lines: 11 > EFTH MINIX report #38 - August 1988 - getcwd(3) My implementation of getcwd(3) has a bug. Thanks to Earl Chew for funding it. (Is there a prize for finding the first V1.4 bug?) The problem arises because getcwd(3) does not reset the current directory before returning. Earl supplied the following fix to set the directory on NON-ERROR returns. Just change the last return() on line 157 to: return( chdir( buffer ) ? NULL : buffer );