Kaydet (Commit) 6c9c0905 authored tarafından Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

Remove unused code in posixmodule.c

üst bc85d848
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment