summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 845b42c)
raw | patch | inline | side by side (parent: 845b42c)
author | Simon Hausmann <shausman@trolltech.com> | |
Thu, 7 Jun 2007 07:37:13 +0000 (09:37 +0200) | ||
committer | Simon Hausmann <shausman@trolltech.com> | |
Thu, 7 Jun 2007 07:37:13 +0000 (09:37 +0200) |
Need to use min instead of max for prev/cur to avoid out-of-bounds
string access. Also treat "i" as index of the last match instead of
a length because in case of a complete match of the two strings
i was off by one.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
string access. Also treat "i" as index of the last match instead of
a length because in case of a complete match of the two strings
i was off by one.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
contrib/fast-import/git-p4 | patch | blob | history |
index e576f2dd9efb39fcb86eda826b18a059828a87ef..ba34f0a61f10aabf9ab8cf712d02bf3a15b33224 100755 (executable)
else:
paths = []
for (prev, cur) in zip(self.previousDepotPaths, depotPaths):
- for i in range(0, max(len(cur), len(prev))):
+ for i in range(0, min(len(cur), len(prev))):
if cur[i] <> prev[i]:
+ i = i - 1
break
- paths.append (cur[:i])
+ paths.append (cur[:i + 1])
self.previousDepotPaths = paths