aboutsummaryrefslogtreecommitdiff
path: root/Python/fileutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/fileutils.c')
-rw-r--r--Python/fileutils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 173d34dd23..3d8f3a4f16 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -2169,6 +2169,18 @@ _Py_add_relfile(wchar_t *dirname, const wchar_t *relfile, size_t bufsize)
}
+size_t
+_Py_find_basename(const wchar_t *filename)
+{
+ for (size_t i = wcslen(filename); i > 0; --i) {
+ if (filename[i] == SEP) {
+ return i + 1;
+ }
+ }
+ return 0;
+}
+
+
/* Get the current directory. buflen is the buffer size in wide characters
including the null character. Decode the path from the locale encoding.