Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
67504f46
Commit
67504f46
authored
Jul 17, 2000
by
Skip Montanaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* split on / or \
* case insensitive
parent
01da6056
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
Lib/dospath.py
Lib/dospath.py
+3
-6
No files found.
Lib/dospath.py
View file @
67504f46
...
...
@@ -107,12 +107,9 @@ def dirname(p):
def
commonprefix
(
m
):
"Given a list of pathnames, returns the longest common leading component"
if
not
m
:
return
''
n
=
m
[:]
n
=
m
ap
(
string
.
lower
,
m
)
for
i
in
range
(
len
(
n
)):
n
[
i
]
=
n
[
i
].
split
(
os
.
sep
)
# if os.sep didn't have any effect, try os.altsep
if
os
.
altsep
and
len
(
n
[
i
])
==
1
:
n
[
i
]
=
n
[
i
].
split
(
os
.
altsep
)
n
[
i
]
=
re
.
split
(
r"[/\\]"
,
n
[
i
])
prefix
=
n
[
0
]
for
item
in
n
:
...
...
@@ -121,7 +118,7 @@ def commonprefix(m):
prefix
=
prefix
[:
i
]
if
i
==
0
:
return
''
break
return
os
.
sep
.
join
(
prefix
)
return
"
\
\
"
.
join
(
prefix
)
# Get size, mtime, atime of files.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment