Skip to content

Commit 91af271

Browse files
authored
Merge pull request #3748 from BsAtHome/fix_cppcheck-chdir
Fix cppcheck not finding cmdline files
2 parents 8b0f01f + 9ba1abc commit 91af271

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/cppcheck.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ CXSTD=( --std=c++17 --language=c++ )
2929
CPPCHKCC=( "${CPPCHKOPT[@]}" "${CCSTD[@]}" )
3030
CPPCHKCX=( "${CPPCHKOPT[@]}" "${CXSTD[@]}" )
3131

32-
# Do this from the source directory
33-
cd "$(dirname "$0")/../src" || { echo "Could not change directory to '$(dirname "$0")/../src'"; exit 1; }
34-
3532
# Only process individual files if passed on the command line.
3633
if [ $# -gt 0 ]; then
3734
retval=0
@@ -53,6 +50,9 @@ if [ $# -gt 0 ]; then
5350
exit $retval
5451
fi
5552

53+
# Do the rest from the source directory
54+
cd "$(dirname "$0")/../src" || { echo "Could not change directory to '$(dirname "$0")/../src'"; exit 1; }
55+
5656
docheck() {
5757
local rv
5858
rv=0

0 commit comments

Comments
 (0)