AmendHub

Download:

jcs

/

amend

/

amendments

/

46

bile+util: Sync from other projects


jcs made amendment 46 over 2 years ago
--- bile.c Tue Jan 11 19:28:31 2022 +++ bile.c Tue Jan 18 16:50:07 2022 @@ -427,6 +427,7 @@ bile_read_alloc(struct bile *bile, const OSType type, o = bile_find(bile, type, id); if (o == NULL) { _bile_error = bile->last_error = -1; + *data = NULL; return 0; } --- util.c Mon Jan 10 22:12:47 2022 +++ util.c Mon Jan 17 15:29:55 2022 @@ -497,6 +497,19 @@ getpath(short vRefNum, Str255 fileName, Str255 *ret, b Str255 name; size_t retlen = 0, len; char tmpret[256], tmp[256]; + char *lastcolon; + + if (strchr((char *)fileName + 1, ':') != NULL) { + /* already a full path */ + memcpy(*ret, fileName, 256); + if (!include_file) { + PtoCstr(*ret); + lastcolon = strrchr((char *)*ret, ':'); + lastcolon[0] = '\0'; + CtoPstr(*ret); + } + return 0; + } wdir.ioVRefNum = wdir.ioWDVRefNum = vRefNum; wdir.ioWDIndex = 0;