From 5c607ad4951e4313ecfd2bc42087d5550283880c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Sat, 7 Jan 2017 14:44:33 +0100 Subject: Pass given file names to key-handler instead of real paths Misbehaving command lines in the key-handler that rewrite the given files and thus replace symbolic links instead of their targets shall call realpath(1). Fixes issue #205 and reverts commit 92e3b578. --- exec/key-handler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'exec') diff --git a/exec/key-handler b/exec/key-handler index 03d7499..439ab2e 100644 --- a/exec/key-handler +++ b/exec/key-handler @@ -18,7 +18,7 @@ readonly TMPFILE="/tmp/sxiv.$$" rotate() { degree="$1" - while read file; do + tr '\n' \0' | xargs -0 realpath | sort | uniq | while read file; do case "$(file -b -i "$file")" in image/jpeg*) jpegtran -rotate "$degree" -copy all -outfile "$file" "$file" ;; *) mogrify -rotate "$degree" "$file" ;; -- cgit v1.2.3