summaryrefslogtreecommitdiff
path: root/jh-checksource.sh
diff options
context:
space:
mode:
Diffstat (limited to 'jh-checksource.sh')
-rw-r--r--jh-checksource.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/jh-checksource.sh b/jh-checksource.sh
index c9d1086..e3eff21 100644
--- a/jh-checksource.sh
+++ b/jh-checksource.sh
@@ -15,7 +15,7 @@ safe_files_string=()
min_size=3
normalize_filename() {
- local cwd="`pwd`"
+ local cwd="$(readlink -m -- "$PWD")"
readlink -m -- "$1"|sed "s|^$cwd/|./|"
}
@@ -43,7 +43,7 @@ matches_regexp() {
print-human() {
libremessages warning "The source directory %s contains binary files:" "$PWD"
- sed 's/./ -> &/'
+ sed 's/^/ -> /'
}
print-machine() {
@@ -61,9 +61,8 @@ main() {
done
# Init
- local unsafe_files="$(mktemp)"
- cleanup() { rm -f -- "$unsafe_files"; }
- trap cleanup EXIT
+ local unsafe_files="$(mktemp --tmpdir "${0##*/}.XXXXXXXXXX")"
+ trap "$(printf 'rm -f -- %q' "$unsafe_files")" EXIT
# Heavy lifting
find . -type f -printf '%s %h/%f\n' | # find all files