summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2005-09-15 13:00:34 (GMT)
committerGeorg Brandl <georg@python.org>2005-09-15 13:00:34 (GMT)
commit6953772d906dae738894490a594751bb793d66bd (patch)
tree2cb400d082203df57f3103ec0b973940ff2288d2 /Python/sysmodule.c
parentff5283744581d2034db58a535b9b7b4ecfc3b3cb (diff)
downloadcpython-6953772d906dae738894490a594751bb793d66bd.zip
cpython-6953772d906dae738894490a594751bb793d66bd.tar.gz
cpython-6953772d906dae738894490a594751bb793d66bd.tar.bz2
patch [ 1119423 ] python -c readlink()s and stat()s '-c'
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index dc46697..5a8c7af 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1188,7 +1188,7 @@ PySys_SetArgv(int argc, char **argv)
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 @@ PySys_SetArgv(int argc, char **argv)
}
#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 @@ PySys_SetArgv(int argc, char **argv)
}
}
#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;