aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2022-05-08 13:33:16 +0200
committerAlejandro Colomar <alx@kernel.org>2025-10-29 21:28:46 +0100
commit95e76be4a79b8eba980d079996c8edf495b72cf3 (patch)
tree4c30776370eefd03d5c8ff855b4a5442c1dccd92
parentf28403e4c7b427d0d120c11a174ae646a55ebb6e (diff)
downloadman-pages-95e76be4a79b8eba980d079996c8edf495b72cf3.tar.gz
grepc: grep_macro_*: Allow tabs
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
-rwxr-xr-xbin/grepc8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/grepc b/bin/grepc
index 094c6d5195..a0b3b11895 100755
--- a/bin/grepc
+++ b/bin/grepc
@@ -11,9 +11,9 @@ function grepc_macro_simple()
{
find . -type f \
| grep '\.[ch]$' \
- | xargs grep -l "define $1\b[^(]" \
+ | xargs grep -l "define\s\+$1\b[^(]" \
| sort \
- | xargs pcregrep -Mn "(?s)define $1\b[^(].*?[^\\\\]$" /dev/null \
+ | xargs pcregrep -Mn "(?s)define\s+$1\b[^(].*?[^\\\\]$" /dev/null \
| sed -E 's/^[^: ]+:[0-9]+:/\n\n&\n\n/';
}
@@ -22,9 +22,9 @@ function grepc_macro_func()
{
find . -type f \
| grep '\.[ch]$' \
- | xargs grep -l "define $1(" \
+ | xargs grep -l "define\s\+$1(" \
| sort \
- | xargs pcregrep -Mn "(?s)define $1\(.*?[^\\\\]$" /dev/null \
+ | xargs pcregrep -Mn "(?s)define\s+$1\(.*?[^\\\\]$" /dev/null \
| sed -E 's/^[^: ]+:[0-9]+:/\n\n&\n\n/';
}