From 6c9c09058f78a5f7e32090c1091409c7a5fa00a3 Mon Sep 17 00:00:00 2001 From: Amaury Forgeot d'Arc Date: Fri, 17 Sep 2010 23:39:42 +0000 Subject: [PATCH] Remove unused code in posixmodule.c --- Modules/posixmodule.c | 68 ------------------------------------------- 1 file changed, 68 deletions(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 80260960b5..59692622da 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -557,14 +557,6 @@ posix_error_with_filename(char* name) 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 @@ _pystat_fromstructstat(STRUCT_STAT *st) 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, -- 2.50.0