Skip to content

Commit 235ef7b

Browse files
oontvooselimkeles
authored andcommitted
Fix filename parsing in clang-format-diff.py for paths with spaces
1 parent 00eaff3 commit 235ef7b

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ 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}(.+)" % args.p, line.rstrip())
106106
if match:
107107
filename = match.group(2)
108108
if filename is None:

lldb/source/Target/Process.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,10 +1047,11 @@ bool Process::SetExitStatus(int status, llvm::StringRef exit_string) {
10471047
info->exit_desc = {status, exit_string.str()};
10481048
});
10491049

1050-
helper.DispatchOnExit([&](telemetry::ProcessExitInfo *info) {
1051-
info->module_uuid = module_uuid;
1052-
info->pid = m_pid;
1053-
});
1050+
helper.DispatchOnExit(
1051+
[module_uuid, pid = m_pid](telemetry::ProcessExitInfo *info) {
1052+
info->module_uuid = module_uuid;
1053+
info->pid = pid;
1054+
});
10541055

10551056
m_exit_status = status;
10561057
if (!exit_string.empty())

lldb/source/Target/Target.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,7 @@ void Target::SetExecutableModule(ModuleSP &executable_sp,
15781578
info->is_start_entry = true;
15791579
});
15801580

1581-
helper.DispatchOnExit([&](telemetry::ExecutableModuleInfo *info) {
1581+
helper.DispatchOnExit([&, pid](telemetry::ExecutableModuleInfo *info) {
15821582
info->exec_mod = executable_sp;
15831583
info->uuid = executable_sp->GetUUID();
15841584
info->pid = pid;

0 commit comments

Comments
 (0)