[Python-checkins] python/dist/src/Mac/Modules/file filesupport.py, 1.22, 1.23

tim_one@users.sourceforge.net tim_one at users.sourceforge.net
Mon Jul 18 01:16:20 CEST 2005


Update of /cvsroot/python/python/dist/src/Mac/Modules/file
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15365/Mac/Modules/file

Modified Files:
	filesupport.py 
Log Message:
Whitespace normalization.


Index: filesupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/file/filesupport.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- filesupport.py	12 Jul 2005 21:25:05 -0000	1.22
+++ filesupport.py	17 Jul 2005 23:16:18 -0000	1.23
@@ -205,44 +205,44 @@
 static OSErr
 _PyMac_GetFullPathname(FSSpec *fss, char *path, int len)
 {
-	FSRef fsr;
-	OSErr err;
+        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;
+        *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;
+                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;
 }
 
 """



More information about the Python-checkins mailing list