Skip to content

Commit

Permalink
Fix a filename comparison bug
Browse files Browse the repository at this point in the history
  • Loading branch information
beavailable committed Jan 2, 2024
1 parent 749c8d1 commit 35a6ab2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions share.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,14 +544,14 @@ def cmp_file(self, e1, e2):
ch1 += 32
if 65 <= ch2 <= 90:
ch2 += 32
if ch1 == ch2:
i += 1
elif 49 <= ch1 <= 57 and 49 <= ch2 <= 57:
if 49 <= ch1 <= 57 and 49 <= ch2 <= 57:
num1, idx1 = self._check_number(s1, len1, i)
num2, idx2 = self._check_number(s2, len2, i)
if num1 != num2:
return num1 - num2
i = idx1
elif ch1 == ch2:
i += 1
else:
return ch1 - ch2
return len1 - len2
Expand Down

0 comments on commit 35a6ab2

Please sign in to comment.