Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bcf3b56

Browse files
committed
also set cur dir for standard get/put file
1 parent 86b4049 commit bcf3b56

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Mac/Compat/chdir.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
#include "macdefs.h"
66

7+
/* Last directory used by Standard File */
8+
#define SFSaveDisk (*(short *)0x214)
9+
#define CurDirStore (*(long *)0x398)
10+
711
/* Change current directory. */
812

913
int
@@ -19,5 +23,10 @@ chdir(path)
1923
errno= ENOENT;
2024
return -1;
2125
}
26+
if (PBHGetVol(&pb, FALSE) == noErr) {
27+
/* Set the Standard File directory */
28+
SFSaveDisk= -pb.ioWDVRefNum;
29+
CurDirStore= pb.ioWDDirID;
30+
}
2231
return 0;
2332
}

0 commit comments

Comments
 (0)