[Python-checkins] r84869 - python/branches/py3k/Modules/posixmodule.c
amaury.forgeotdarc
python-checkins at python.org
Sat Sep 18 01:39:42 CEST 2010
Author: amaury.forgeotdarc
Date: Sat Sep 18 01:39:42 2010
New Revision: 84869
Log:
Remove unused code in posixmodule.c
Modified:
python/branches/py3k/Modules/posixmodule.c
Modified: python/branches/py3k/Modules/posixmodule.c
==============================================================================
--- python/branches/py3k/Modules/posixmodule.c (original)
+++ python/branches/py3k/Modules/posixmodule.c Sat Sep 18 01:39:42 2010
@@ -557,14 +557,6 @@
return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
}
-#ifdef MS_WINDOWS
-static PyObject *
-posix_error_with_unicode_filename(Py_UNICODE* name)
-{
- return PyErr_SetFromErrnoWithUnicodeFilename(PyExc_OSError, name);
-}
-#endif /* MS_WINDOWS */
-
static PyObject *
posix_error_with_allocated_filename(PyObject* name)
@@ -1628,66 +1620,6 @@
return v;
}
-#ifdef MS_WINDOWS
-
-/* IsUNCRoot -- test whether the supplied path is of the form \\SERVER\SHARE\,
- where / can be used in place of \ and the trailing slash is optional.
- Both SERVER and SHARE must have at least one character.
-*/
-
-#define ISSLASHA(c) ((c) == '\\' || (c) == '/')
-#define ISSLASHW(c) ((c) == L'\\' || (c) == L'/')
-#ifndef ARRAYSIZE
-#define ARRAYSIZE(a) (sizeof(a) / sizeof(a[0]))
-#endif
-
-static BOOL
-IsUNCRootA(char *path, int pathlen)
-{
- #define ISSLASH ISSLASHA
-
- int i, share;
-
- if (pathlen < 5 || !ISSLASH(path[0]) || !ISSLASH(path[1]))
- /* minimum UNCRoot is \\x\y */
- return FALSE;
- for (i = 2; i < pathlen ; i++)
- if (ISSLASH(path[i])) break;
- if (i == 2 || i == pathlen)
- /* do not allow \\\SHARE or \\SERVER */
- return FALSE;
- share = i+1;
- for (i = share; i < pathlen; i++)
- if (ISSLASH(path[i])) break;
- return (i != share && (i == pathlen || i == pathlen-1));
-
- #undef ISSLASH
-}
-
-static BOOL
-IsUNCRootW(Py_UNICODE *path, int pathlen)
-{
- #define ISSLASH ISSLASHW
-
- int i, share;
-
- if (pathlen < 5 || !ISSLASH(path[0]) || !ISSLASH(path[1]))
- /* minimum UNCRoot is \\x\y */
- return FALSE;
- for (i = 2; i < pathlen ; i++)
- if (ISSLASH(path[i])) break;
- if (i == 2 || i == pathlen)
- /* do not allow \\\SHARE or \\SERVER */
- return FALSE;
- share = i+1;
- for (i = share; i < pathlen; i++)
- if (ISSLASH(path[i])) break;
- return (i != share && (i == pathlen || i == pathlen-1));
-
- #undef ISSLASH
-}
-#endif /* MS_WINDOWS */
-
static PyObject *
posix_do_stat(PyObject *self, PyObject *args,
char *format,
More information about the Python-checkins
mailing list