diff options
author | Guido van Rossum <guido@python.org> | 2000-05-03 02:44:55 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-05-03 02:44:55 (GMT) |
commit | 19dde103a80525ea02565a4d218708ee028dd2dd (patch) | |
tree | 8860a50245423dbb6e9119b0486c0aa26d82b44f /Modules/posixmodule.c | |
parent | be317e615e9c25f3f38062266b9b8a7ad86a1c90 (diff) | |
download | cpython-19dde103a80525ea02565a4d218708ee028dd2dd.zip cpython-19dde103a80525ea02565a4d218708ee028dd2dd.tar.gz cpython-19dde103a80525ea02565a4d218708ee028dd2dd.tar.bz2 |
Mark Hammond to the rescue:
Checkin 2.131 of posixmodule.c changed os.stat on Windows, so that
"/bin/" type notation (trailing backslash) would work on Windows to
be consistent with Unix.
However, the patch broke the simple case of: os.stat("\\")
This did work in 1.5.2, and obviously should!
This patch addresses this, and restores the correct behaviour.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index b62cce0..1ca3826 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -567,10 +567,11 @@ posix_do_stat(self, args, format, statfunc) } if ((pathlen > 0) && (path[pathlen-1] == '\\' || path[pathlen-1] == '/')) { - /* exception for drive root */ - if (!((pathlen == 3) && + /* exception for specific or current drive root */ + if (!((pathlen == 1) || + ((pathlen == 3) && (path[1] == ':') && - (path[2] == '\\' || path[2] == '/'))) + (path[2] == '\\' || path[2] == '/')))) { strncpy(pathcopy, path, pathlen); pathcopy[pathlen-1] = '\0'; /* nuke the trailing backslash */ |