From: Alejandro Colomar Date: Sat, 3 May 2025 12:37:19 +0000 (+0200) Subject: bin/grepc: Add robustness against non-portable pathnames X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44af9be2e57fd3ef6ee45cc77183637f0210fe0c;p=thirdparty%2Fman-pages.git bin/grepc: Add robustness against non-portable pathnames Signed-off-by: Alejandro Colomar --- diff --git a/bin/grepc b/bin/grepc index 6d9c79b78..5e7f2ee2c 100755 --- a/bin/grepc +++ b/bin/grepc @@ -229,13 +229,13 @@ opts=($A $B $C $c $h $i $l -M $m $n); if test -z "$*"; then pcre2grep "${opts[@]}" -f "$patterns"; else - find "$@" -type f \ + find "$@" -type f -print0 \ | if test -z "$c"; then - xargs grep -lPI $i -- "$identifier"; + xargs -0 grep -lZPI $i -- "$identifier"; else cat; fi \ - | xargs pcre2grep "${opts[@]}" -f "$patterns"; + | xargs -0 pcre2grep "${opts[@]}" -f "$patterns"; fi \ | perl -p <( test "$r" = 'yes' \