1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 11:01:45 +00:00

Fix infinite loop when matching ignore patterns

This commit is contained in:
Mo Hyun
2024-10-22 09:20:57 -07:00
committed by deadc0de
parent dc0db530e1
commit d25eae45f4

View File

@@ -19,6 +19,7 @@ import json
import sys
import requests
from packaging import version
from pathlib import PurePath
# local import
from dotdrop.logger import Logger
@@ -231,7 +232,7 @@ def _match_ignore_pattern(path, pattern, debug=False):
be able to match pattern like "*/dir"
"""
subpath = path
while subpath != os.path.sep:
while subpath != PurePath(path).anchor:
# if debug:
# msg = f'fnmatch \"{subpath}\" against {pattern}'
# LOG.dbg(msg, force=True)