lint: simplify find command in exclude_paths_common_asn1c()

The purpose of "cut -d / -f 2-" is to strip off leading "./" in
the paths.  The same can be achieved by doing "-printf '%P\n'".

Matching "*.c" and "*.h" files can be expressed as "-name *.[hc]".

Change-Id: Iae3fc5c8842df6926e6ff16a41be5663f1dedd1b
This commit is contained in:
Vadim Yanitskiy 2022-07-03 04:55:41 +07:00
parent e6ad3a2b2f
commit 4f8a4954b9
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ exclude_paths_common() {
exclude_paths_common_asn1c() {
local pattern="^ \* Generated by asn1c-"
local files="$(find -name '*.c' -o -name '*.h' | cut -d / -f 2-)"
local files="$(find -name '*.[hc]' -printf '%P\n')"
local i
if [ -z "$files" ]; then