[Python-checkins] r42713 - python/trunk/Modules/posixmodule.c

tim.peters python-checkins at python.org
Wed Mar 1 05:35:50 CET 2006


Author: tim.peters
Date: Wed Mar  1 05:35:45 2006
New Revision: 42713

Modified:
   python/trunk/Modules/posixmodule.c
Log:
Repair mangled code in the Windows flavor of
posix__getfullpathname().

In partial answer to the now-deleted XXX comment:

	/* XXX(twouters) Why use 'et#' here at all? insize isn't used */

`insize` is an input parameter too, and it was left uninitialized,
leading to seemingly random failures.


Modified: python/trunk/Modules/posixmodule.c
==============================================================================
--- python/trunk/Modules/posixmodule.c	(original)
+++ python/trunk/Modules/posixmodule.c	Wed Mar  1 05:35:45 2006
@@ -1901,7 +1901,7 @@
 	/* assume encoded strings wont more than double no of chars */
 	char inbuf[MAX_PATH*2];
 	char *inbufp = inbuf;
-	Py_ssize_t insize;
+	Py_ssize_t insize = sizeof(inbuf);
 	char outbuf[MAX_PATH*2];
 	char *temp;
 #ifdef Py_WIN_WIDE_FILENAMES
@@ -1921,7 +1921,6 @@
 		PyErr_Clear();
 	}
 #endif
-	/* XXX(twouters) Why use 'et#' here at all? insize isn't used */
 	if (!PyArg_ParseTuple (args, "et#:_getfullpathname",
 	                       Py_FileSystemDefaultEncoding, &inbufp,
 	                       &insize))


More information about the Python-checkins mailing list