diff options
author | Tim Peters <tim.peters@gmail.com> | 2005-07-17 23:16:17 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2005-07-17 23:16:17 (GMT) |
commit | f5f32b47128763a1f782782bd5a1a125b6d8b28b (patch) | |
tree | 101943572734eccd843559bdc6520d5b2ca0a192 /Mac/Modules | |
parent | c48a740887c80a4e6686486d62171f9efe64921c (diff) | |
download | cpython-f5f32b47128763a1f782782bd5a1a125b6d8b28b.zip cpython-f5f32b47128763a1f782782bd5a1a125b6d8b28b.tar.gz cpython-f5f32b47128763a1f782782bd5a1a125b6d8b28b.tar.bz2 |
Whitespace normalization.
Diffstat (limited to 'Mac/Modules')
-rw-r--r-- | Mac/Modules/file/filesupport.py | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/Mac/Modules/file/filesupport.py b/Mac/Modules/file/filesupport.py index a6ac536..d0e88f0 100644 --- a/Mac/Modules/file/filesupport.py +++ b/Mac/Modules/file/filesupport.py @@ -205,44 +205,44 @@ PyMac_BuildHFSUniStr255(HFSUniStr255 *itself) static OSErr _PyMac_GetFullPathname(FSSpec *fss, char *path, int len) { - FSRef fsr; - OSErr err; - - *path = '\0'; - err = FSpMakeFSRef(fss, &fsr); - if (err == fnfErr) { - /* FSSpecs can point to non-existing files, fsrefs can't. */ - FSSpec fss2; - int tocopy; - - err = FSMakeFSSpec(fss->vRefNum, fss->parID, "", &fss2); - if (err) - return err; - err = FSpMakeFSRef(&fss2, &fsr); - if (err) - return err; - err = (OSErr)FSRefMakePath(&fsr, path, len-1); - if (err) - return err; - /* This part is not 100% safe: we append the filename part, but - ** I'm not sure that we don't run afoul of the various 8bit - ** encodings here. Will have to look this up at some point... - */ - strcat(path, "/"); - tocopy = fss->name[0]; - if ((strlen(path) + tocopy) >= len) - tocopy = len - strlen(path) - 1; - if (tocopy > 0) - strncat(path, fss->name+1, tocopy); - } - else { - if (err) - return err; - err = (OSErr)FSRefMakePath(&fsr, path, len); - if (err) - return err; - } - return 0; + FSRef fsr; + OSErr err; + + *path = '\0'; + err = FSpMakeFSRef(fss, &fsr); + if (err == fnfErr) { + /* FSSpecs can point to non-existing files, fsrefs can't. */ + FSSpec fss2; + int tocopy; + + err = FSMakeFSSpec(fss->vRefNum, fss->parID, "", &fss2); + if (err) + return err; + err = FSpMakeFSRef(&fss2, &fsr); + if (err) + return err; + err = (OSErr)FSRefMakePath(&fsr, path, len-1); + if (err) + return err; + /* This part is not 100% safe: we append the filename part, but + ** I'm not sure that we don't run afoul of the various 8bit + ** encodings here. Will have to look this up at some point... + */ + strcat(path, "/"); + tocopy = fss->name[0]; + if ((strlen(path) + tocopy) >= len) + tocopy = len - strlen(path) - 1; + if (tocopy > 0) + strncat(path, fss->name+1, tocopy); + } + else { + if (err) + return err; + err = (OSErr)FSRefMakePath(&fsr, path, len); + if (err) + return err; + } + return 0; } """ |