From 4a1262782ebe76d974b40ea900a85c7cfcfd42d9 Mon Sep 17 00:00:00 2001 From: Nikita Nemkin Date: Thu, 23 Jan 2025 10:56:37 +0500 Subject: [PATCH] clang-format.bash: Preserve CRLF line endings on Windows Use the binary mode of GNU sed. --- clang-format.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang-format.bash b/clang-format.bash index 0ae8809..2561a89 100755 --- a/clang-format.bash +++ b/clang-format.bash @@ -121,8 +121,8 @@ list_files() { } # Transform configured sources to protect @SYMBOLS@. -list_files | xargs -d '\n' sed -i 's/@\(KWSYS_[A-Z0-9_]\+\)@/x\1x/g' +list_files | xargs -d '\n' sed -i -b 's/@\(KWSYS_[A-Z0-9_]\+\)@/x\1x/g' # Update sources in-place. list_files | xargs -d '\n' "$clang_format" -i # Transform configured sources to restore @SYMBOLS@. -list_files | xargs -d '\n' sed -i 's/x\(KWSYS_[A-Z0-9_]\+\)x/@\1@/g' +list_files | xargs -d '\n' sed -i -b 's/x\(KWSYS_[A-Z0-9_]\+\)x/@\1@/g' -- GitLab