Commit 2f324dd8 authored by Sumera Priyadarsini's avatar Sumera Priyadarsini Committed by Julia Lawall
Browse files

scripts: coccicheck: Add quotes to improve portability



While fetching the number of threads per core with lscpu,
the [:digit:] set is used for translation of digits from 0-9.
However, using [:digit:] instead of "[:digit:]" does not seem
to work uniformly for some shell types and configurations
(such as zsh).

Therefore, modify coccicheck to use double quotes around the
[:digit:] set for uniformity and better portability.

Signed-off-by: default avatarSumera Priyadarsini <sylphrenadin@gmail.com>
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
parent 28c185a8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ else
    fi

    # Use only one thread per core by default if hyperthreading is enabled
    THREADS_PER_CORE=$(lscpu | grep "Thread(s) per core: " | tr -cd [:digit:])
    THREADS_PER_CORE=$(lscpu | grep "Thread(s) per core: " | tr -cd "[:digit:]")
    if [ -z "$J" ]; then
        NPROC=$(getconf _NPROCESSORS_ONLN)
	if [ $THREADS_PER_CORE -gt 1 -a $NPROC -gt 2 ] ; then