[Python-checkins] python/dist/src/Python sysmodule.c, 2.126.2.2, 2.126.2.3

birkenfeld@users.sourceforge.net birkenfeld at users.sourceforge.net
Thu Sep 15 15:00:30 CEST 2005


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27745/Python

Modified Files:
      Tag: release24-maint
	sysmodule.c 
Log Message:
backport patch [ 1119423 ] python -c readlink()s and stat()s '-c'



Index: sysmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v
retrieving revision 2.126.2.2
retrieving revision 2.126.2.3
diff -u -d -r2.126.2.2 -r2.126.2.3
--- sysmodule.c	27 Jan 2005 18:58:30 -0000	2.126.2.2
+++ sysmodule.c	15 Sep 2005 13:00:25 -0000	2.126.2.3
@@ -1188,7 +1188,7 @@
 		char link[MAXPATHLEN+1];
 		char argv0copy[2*MAXPATHLEN+1];
 		int nr = 0;
-		if (argc > 0 && argv0 != NULL)
+		if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0)
 			nr = readlink(argv0, link, MAXPATHLEN);
 		if (nr > 0) {
 			/* It's a symlink */
@@ -1213,7 +1213,7 @@
 		}
 #endif /* HAVE_READLINK */
 #if SEP == '\\' /* Special case for MS filename syntax */
-		if (argc > 0 && argv0 != NULL) {
+		if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
 			char *q;
 #ifdef MS_WINDOWS
 			char *ptemp;
@@ -1236,7 +1236,7 @@
 			}
 		}
 #else /* All other filename syntaxes */
-		if (argc > 0 && argv0 != NULL) {
+		if (argc > 0 && argv0 != NULL && strcmp(argv0, "-c") != 0) {
 #if defined(HAVE_REALPATH)
 			if (realpath(argv0, fullpath)) {
 				argv0 = fullpath;



More information about the Python-checkins mailing list