diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2022-07-03 04:55:41 +0700 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2022-07-03 04:55:54 +0700 |
commit | 4f8a4954b9b9ccb4d28df64ee3ba6095167fdd34 (patch) | |
tree | a9b2c52f9f99c1ad03d5b456aeaff5eca76b4432 | |
parent | e6ad3a2b2fdcd366be79ec7c8d09b6f2b4efa146 (diff) |
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
-rwxr-xr-x | lint/checkpatch/checkpatch_osmo.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lint/checkpatch/checkpatch_osmo.sh b/lint/checkpatch/checkpatch_osmo.sh index a12d0a1..b0c3985 100755 --- a/lint/checkpatch/checkpatch_osmo.sh +++ b/lint/checkpatch/checkpatch_osmo.sh @@ -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 |