equal
deleted
inserted
replaced
136 |
136 |
137 def ispathsafe(path): |
137 def ispathsafe(path): |
138 """Determine if a path is safe to use for filesystem access.""" |
138 """Determine if a path is safe to use for filesystem access.""" |
139 parts = path.split('/') |
139 parts = path.split('/') |
140 for part in parts: |
140 for part in parts: |
141 if (part in ('', os.curdir, os.pardir) or |
141 if (part in ('', os.curdir, pycompat.ospardir) or |
142 pycompat.ossep in part or |
142 pycompat.ossep in part or |
143 pycompat.osaltsep is not None and pycompat.osaltsep in part): |
143 pycompat.osaltsep is not None and pycompat.osaltsep in part): |
144 return False |
144 return False |
145 |
145 |
146 return True |
146 return True |