From 48c95439badea16d38ef6f230fe64bc6524ed90e Mon Sep 17 00:00:00 2001 From: TimePath Date: Fri, 30 Mar 2018 16:03:34 +1100 Subject: [PATCH] Support BSD sed --- cmake/qcc.sh | 2 +- qcsrc/tools/qcc.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/qcc.sh b/cmake/qcc.sh index b7c77fd56..78119a596 100755 --- a/cmake/qcc.sh +++ b/cmake/qcc.sh @@ -3,7 +3,7 @@ CPP=${CPP:-cpp} QCC=${QCC:-$PWD/../../gmqcc/gmqcc${CMAKE_EXECUTABLE_SUFFIX}} case $1 in compile) - ${CPP} ${@:3} | sed 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' > $2 + ${CPP} ${@:3} | sed -E 's/^#(line)? ([[:digit:]]+) "(.*)".*/'$'\\\n''#pragma file(\3)'$'\\\n''#pragma line(\2)/g' > $2 ;; link) ${QCC} \ diff --git a/qcsrc/tools/qcc.sh b/qcsrc/tools/qcc.sh index 15cbfc4aa..865e6e592 100755 --- a/qcsrc/tools/qcc.sh +++ b/qcsrc/tools/qcc.sh @@ -32,7 +32,7 @@ function qpp() { err=$? set -e if [ ${err} -ne 0 ]; then return ${err}; fi - sed 's/^#\(line\)\? \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\3)\n#pragma line(\2)/g' "${WORKDIR}/${MODE}.txt" + sed -E 's/^#(line)? ([[:digit:]]+) "(.*)".*/'$'\\\n''#pragma file(\3)'$'\\\n''#pragma line(\2)/g' "${WORKDIR}/${MODE}.txt" } function qcc() { -- 2.39.2