From 61d7539eef9545170d6ae164fd04c72a1897184a Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 5 Nov 2023 17:33:26 +0100 Subject: bin/grepc: srcfix (Use printf '%s\n' instead of echo) Reported-by: terdon Signed-off-by: Alejandro Colomar --- bin/grepc | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/bin/grepc b/bin/grepc index 4f1001f..ef965a3 100755 --- a/bin/grepc +++ b/bin/grepc @@ -38,7 +38,7 @@ t_ut_td_su='no'; grepc_err() { - >&2 echo "$(basename "$0"): error: $*"; + >&2 printf '%s\n' "$(basename "$0"): error: $*"; exit 1; } @@ -123,28 +123,28 @@ if [ "$t" = 'no' ]; then fi; -grepc_e() { echo '(?s)^([\w[]+[\w\s]*)?\benum\b[ \t]*([\w \t[\]]|::)*\n*([ \t]*){[^}]*^[ \t]*'"$1"'\b\s*[=,].*?^\3}.*?;'; } -grepc_fp() { echo '(?s)^[\w[](?:[\w\s\(,\)[\]*]|::)+[\w\s\)*\]]\s+\**\(?'"$1"'\)?\s*(\((?:[\w\s,[\]*]|::|(?1))*(?:\.\.\.)?\))(?:[\w\s\(,\)[\]]|::)*;'; } -grepc_fd() { echo '(?s)^[\w[](?:[\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**\(?'"$1"'\)?\s*(\((?:[\w\s,[\]*]|::|(?1))*(?:\.\.\.)?\))[ \t]*\n([ \t]*){.*?^\2}'; } +grepc_e() { printf '%s\n' '(?s)^([\w[]+[\w\s]*)?\benum\b[ \t]*([\w \t[\]]|::)*\n*([ \t]*){[^}]*^[ \t]*'"$1"'\b\s*[=,].*?^\3}.*?;'; } +grepc_fp() { printf '%s\n' '(?s)^[\w[](?:[\w\s\(,\)[\]*]|::)+[\w\s\)*\]]\s+\**\(?'"$1"'\)?\s*(\((?:[\w\s,[\]*]|::|(?1))*(?:\.\.\.)?\))(?:[\w\s\(,\)[\]]|::)*;'; } +grepc_fd() { printf '%s\n' '(?s)^[\w[](?:[\w\s\(,\)[\]*]|::)*[\w\s\)*\]]\s+\**\(?'"$1"'\)?\s*(\((?:[\w\s,[\]*]|::|(?1))*(?:\.\.\.)?\))[ \t]*\n([ \t]*){.*?^\2}'; } grepc_fgd_libm() { grepc_fd "M_DECL_FUNC \(__$1\)"; } grepc_fgd_libio() { grepc_fd "_IO_$1"; } grepc_fgp_libio() { grepc_fp "_IO_$1"; } grepc_fgp() { grepc_fgp_libio "$1"; } -grepc_flp() { echo '(?s)^asmlinkage\s+[\w\s]+\**sys_'"$1"'\s*\(.*?\)'; } -grepc_fld() { echo '(?s)^(COMPAT_)?SYSCALL_DEFINE.\('"$1"'\b.*?^}'; } -grepc_mf() { echo '(?s)^[ \t]*#\s*define\s[\s\\]*'"$1"'\(.*?[^\\]$'; } -grepc_mo() { echo '(?s)^[ \t]*#\s*define\s[\s\\]*'"$1"'\b(?!\().*?(?