Show More
@@ -204,15 +204,20 b' def _hybridencode(path, auxencode):' | |||
|
204 | 204 | basename = parts[-1] |
|
205 | 205 | _root, ext = os.path.splitext(basename) |
|
206 | 206 | sdirs = [] |
|
207 | sdirslen = 0 | |
|
207 | 208 | for p in parts[:-1]: |
|
208 | 209 | d = p[:_dirprefixlen] |
|
209 | 210 | if d[-1] in '. ': |
|
210 | 211 | # Windows can't access dirs ending in period or space |
|
211 | 212 | d = d[:-1] + '_' |
|
212 | t = '/'.join(sdirs) + '/' + d | |
|
213 | if len(t) > _maxshortdirslen: | |
|
213 | if sdirslen == 0: | |
|
214 | t = len(d) | |
|
215 | else: | |
|
216 | t = sdirslen + 1 + len(d) | |
|
217 | if t > _maxshortdirslen: | |
|
214 | 218 | break |
|
215 | 219 | sdirs.append(d) |
|
220 | sdirslen = t | |
|
216 | 221 | dirs = '/'.join(sdirs) |
|
217 | 222 | if len(dirs) > 0: |
|
218 | 223 | dirs += '/' |
General Comments 0
You need to be logged in to leave comments.
Login now