mercurial/archival.py
changeset 24953 5115d03440f4
parent 24681 33ab99a6ad9b
child 25149 3f0744eeaeaf
equal deleted inserted replaced
24951:eeca859cc045 24953:5115d03440f4
    35                 break
    35                 break
    36     lpfx = os.path.normpath(util.localpath(prefix))
    36     lpfx = os.path.normpath(util.localpath(prefix))
    37     prefix = util.pconvert(lpfx)
    37     prefix = util.pconvert(lpfx)
    38     if not prefix.endswith('/'):
    38     if not prefix.endswith('/'):
    39         prefix += '/'
    39         prefix += '/'
       
    40     # Drop the leading '.' path component if present, so Windows can read the
       
    41     # zip files (issue4634)
       
    42     if prefix.startswith('./'):
       
    43         prefix = prefix[2:]
    40     if prefix.startswith('../') or os.path.isabs(lpfx) or '/../' in prefix:
    44     if prefix.startswith('../') or os.path.isabs(lpfx) or '/../' in prefix:
    41         raise util.Abort(_('archive prefix contains illegal components'))
    45         raise util.Abort(_('archive prefix contains illegal components'))
    42     return prefix
    46     return prefix
    43 
    47 
    44 exts = {
    48 exts = {