Skip to content

Commit 348b672

Browse files
lsytj0413julienschmidt
authored andcommitted
small enhance at CleanPath (#243)
1 parent adbc77e commit 348b672

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

path.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ func CleanPath(p string) string {
5959

6060
case p[r] == '.' && p[r+1] == '/':
6161
// . element
62-
r++
62+
r += 2
6363

6464
case p[r] == '.' && p[r+1] == '.' && (r+2 == n || p[r+2] == '/'):
6565
// .. element: remove to last /
66-
r += 2
66+
r += 3
6767

6868
if w > 1 {
6969
// can backtrack

0 commit comments

Comments
 (0)