X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=mac%2Fmacstore.c;h=548b7ac2529622cd4dc41ff9da0e2da83cec48f1;hb=7573f3733f3ba896018dc7b1cdd2b3a51b450096;hp=30eb1cf3a102d2b654624abb2a73a65361aee94c;hpb=5c9e56ba3e323e4919dfdf03d75b76da5c584e88;p=PuTTY.git diff --git a/mac/macstore.c b/mac/macstore.c index 30eb1cf3..548b7ac2 100644 --- a/mac/macstore.c +++ b/mac/macstore.c @@ -1,4 +1,4 @@ -/* $Id: macstore.c,v 1.17 2003/03/27 22:46:28 ben Exp $ */ +/* $Id: macstore.c,v 1.19 2003/04/01 18:10:25 simon Exp $ */ /* * macstore.c: Macintosh-specific impementation of the interface @@ -116,13 +116,15 @@ struct write_settings { FSSpec dstfile; }; -void *open_settings_w(char const *sessionname) { +void *open_settings_w(char const *sessionname, char **errmsg) { short sessVRefNum; long sessDirID; OSErr error; Str255 psessionname; FSSpec dstfile; - + + *errmsg = NULL; + error = get_session_dir(kCreateFolder, &sessVRefNum, &sessDirID); if (error != noErr) return NULL; @@ -149,7 +151,7 @@ void *open_settings_w_fsp(FSSpec *dstfile) OSErr error; Str255 tmpname; - ws = smalloc(sizeof *ws); + ws = snew(struct write_settings); ws->dstfile = *dstfile; /* Create a temporary file to save to first. */ @@ -278,7 +280,7 @@ void *open_settings_r_fsp(FSSpec *sessfile) fd = FSpOpenResFile(sessfile, fsRdPerm); if (fd == 0) {error = ResError(); goto out;} - handle = smalloc(sizeof *handle); + handle = snew(int); *handle = fd; return handle;