##// END OF EJS Templates
store: fix many single-byte ops to use slicing in _auxencode
Augie Fackler -
r31362:50cd8134 default
parent child Browse files
Show More
@@ -193,22 +193,22 b' def _auxencode(path, dotencode):'
193 if not n:
193 if not n:
194 continue
194 continue
195 if dotencode and n[0] in '. ':
195 if dotencode and n[0] in '. ':
196 n = "~%02x" % ord(n[0]) + n[1:]
196 n = "~%02x" % ord(n[0:1]) + n[1:]
197 path[i] = n
197 path[i] = n
198 else:
198 else:
199 l = n.find('.')
199 l = n.find('.')
200 if l == -1:
200 if l == -1:
201 l = len(n)
201 l = len(n)
202 if ((l == 3 and n[:3] in _winres3) or
202 if ((l == 3 and n[:3] in _winres3) or
203 (l == 4 and n[3] <= '9' and n[3] >= '1'
203 (l == 4 and n[3:4] <= '9' and n[3:4] >= '1'
204 and n[:3] in _winres4)):
204 and n[:3] in _winres4)):
205 # encode third letter ('aux' -> 'au~78')
205 # encode third letter ('aux' -> 'au~78')
206 ec = "~%02x" % ord(n[2])
206 ec = "~%02x" % ord(n[2:3])
207 n = n[0:2] + ec + n[3:]
207 n = n[0:2] + ec + n[3:]
208 path[i] = n
208 path[i] = n
209 if n[-1] in '. ':
209 if n[-1] in '. ':
210 # encode last period or space ('foo...' -> 'foo..~2e')
210 # encode last period or space ('foo...' -> 'foo..~2e')
211 path[i] = n[:-1] + "~%02x" % ord(n[-1])
211 path[i] = n[:-1] + "~%02x" % ord(n[-1:])
212 return path
212 return path
213
213
214 _maxstorepathlen = 120
214 _maxstorepathlen = 120
General Comments 0
You need to be logged in to leave comments. Login now