equal
deleted
inserted
replaced
603 |
603 |
604 def globmatch(el, l): |
604 def globmatch(el, l): |
605 # The only supported special characters are * and ? plus / which also |
605 # The only supported special characters are * and ? plus / which also |
606 # matches \ on windows. Escaping of these caracters is supported. |
606 # matches \ on windows. Escaping of these caracters is supported. |
607 if el + '\n' == l: |
607 if el + '\n' == l: |
608 if os.name == 'nt': |
608 if os.altsep: |
609 # matching on "/" is not needed for this line |
609 # matching on "/" is not needed for this line |
610 log("\nInfo, unnecessary glob: %s (glob)" % el) |
610 log("\nInfo, unnecessary glob: %s (glob)" % el) |
611 return True |
611 return True |
612 i, n = 0, len(el) |
612 i, n = 0, len(el) |
613 res = '' |
613 res = '' |
619 i += 1 |
619 i += 1 |
620 elif c == '*': |
620 elif c == '*': |
621 res += '.*' |
621 res += '.*' |
622 elif c == '?': |
622 elif c == '?': |
623 res += '.' |
623 res += '.' |
624 elif c == '/' and os.name == 'nt': |
624 elif c == '/' and os.altsep: |
625 res += '[/\\\\]' |
625 res += '[/\\\\]' |
626 else: |
626 else: |
627 res += re.escape(c) |
627 res += re.escape(c) |
628 return rematch(res, l) |
628 return rematch(res, l) |
629 |
629 |