Skip to content

Commit

Permalink
simplified valgrind wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
dmalan committed Jan 4, 2024
1 parent a2bb6bf commit f2d4a35
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions opt/cs50/bin/valgrind
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/bin/bash

# Don't run on Python programs
for arg; do
if echo "$arg" | grep -Eq "(^python|\.py$)"; then
echo "Afraid valgrind does not support Python programs!"
exit 1
fi
done
# If run on Python program
if [[ "$1" == "python" || "$1" == *.py ]]; then
echo "Afraid valgrind does not support Python programs!"
exit 1
fi

/usr/bin/valgrind $*
/usr/bin/valgrind "$@"

0 comments on commit f2d4a35

Please sign in to comment.