Show More
@@ -910,16 +910,17 b' def parsefilename(str):' | |||
|
910 | 910 | return s[:i] |
|
911 | 911 | |
|
912 | 912 | def selectfile(afile_orig, bfile_orig, hunk, strip): |
|
913 |
def pathstrip(path, |
|
|
913 | def pathstrip(path, strip): | |
|
914 | 914 | pathlen = len(path) |
|
915 | 915 | i = 0 |
|
916 |
if |
|
|
916 | if strip == 0: | |
|
917 | 917 | return '', path.rstrip() |
|
918 | count = strip | |
|
918 | 919 | while count > 0: |
|
919 | 920 | i = path.find('/', i) |
|
920 | 921 | if i == -1: |
|
921 | raise PatchError(_("unable to strip away %d dirs from %s") % | |
|
922 | (count, path)) | |
|
922 | raise PatchError(_("unable to strip away %d of %d dirs from %s") % | |
|
923 | (count, strip, path)) | |
|
923 | 924 | i += 1 |
|
924 | 925 | # consume '//' in the path |
|
925 | 926 | while i < pathlen - 1 and path[i] == '/': |
General Comments 0
You need to be logged in to leave comments.
Login now