[PATCH v9 13/15] syscalls: Avoid matching substrings in the ABI parsing
From: André Almeida
Date: Thu Nov 05 2026 - 15:23:54 EST
Currently, the abi parsing for grep will match substrings. For instance, an
ABI called `abc` will match also the ABI called `abcde`. Use the space
limiter to match a complete word and avoid matching substrings.
While here, add a true command in the end of grep command to avoid the
script exiting earlier and being able to do the cleanup.
Signed-off-by: André Almeida <andrealmeid@xxxxxxxxxx>
---
scripts/syscallhdr.sh | 2 +-
scripts/syscalltbl.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/syscallhdr.sh b/scripts/syscallhdr.sh
index cf6bba3019b1..cf35ff05b824 100755
--- a/scripts/syscallhdr.sh
+++ b/scripts/syscallhdr.sh
@@ -109,7 +109,7 @@ gen_hdr() {
tmpfile=$(mktemp)
offset_nr=$2
- grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$input" > $tmpfile
+ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis+[[:space:]]" "$input" > $tmpfile || true
while read nr abi name native compat; do
if [ -n "$offset_nr" ]; then
diff --git a/scripts/syscalltbl.sh b/scripts/syscalltbl.sh
index 1e9cac32c02d..403a604e7c76 100755
--- a/scripts/syscalltbl.sh
+++ b/scripts/syscalltbl.sh
@@ -70,7 +70,7 @@ gen_tbl() {
tmpfile=$(mktemp)
offset_nr=$2
- grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$input" > $tmpfile
+ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis+[[:space:]]" "$input" > $tmpfile || true
while read nr abi name native compat noreturn; do
if [ -n "$offset_nr" ]; then
--
2.56.0