Skip to content

Commit 606802b

Browse files
committed
Fix filename parsing in clang-format-diff.py for files or paths with spaces
1 parent 81499ed commit 606802b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/tools/clang-format/clang-format-diff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ def main():
102102
filename = None
103103
lines_by_file = {}
104104
for line in sys.stdin:
105-
match = re.search(r"^\+\+\+\ (.*?/){%s}(\S*)" % args.p, line)
105+
match = re.search(r"^\+\+\+\s+(?:.*?/){%s}(.+)$" % args.p, line)
106106
if match:
107-
filename = match.group(2)
107+
filename = match.group(1).strip()
108108
if filename is None:
109109
continue
110110

0 commit comments

Comments
 (0)