summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-05 00:07:26 +0100
committerhut <hut@lavabit.com>2013-02-05 00:07:26 +0100
commit4ffc9391f5f389b94248ed20d22839550d26cb12 (patch)
tree5fc5bb74ca5580c23688eeffdb6d5545e0c05fed
parentc4e45fe5e15ec2b26791e0290b917ac0cc411636 (diff)
downloadranger-4ffc9391f5f389b94248ed20d22839550d26cb12.tar.gz
data/scope.sh: fix hanging on password-protectet rar file
-rwxr-xr-xranger/data/scope.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index 0db0947a..7051b7da 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -39,10 +39,14 @@ function highlight { command highlight "$@"; test $? = 0 -o $? = 141; }
 case "$extension" in
 	# Archive extensions:
 	7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
-	rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
+	rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
 		als "$path" | head -n $maxln
 		success && exit 0 || acat "$path" | head -n $maxln && exit 3
 		exit 1;;
+	rar)
+		unrar -p- lt "$path" | head -n $maxln
+		success && exit 0;
+		exit 1;;
 	# PDF documents:
 	pdf)
 		pdftotext -l 10 -nopgbrk -q "$path" - | head -n $maxln | fmt -s -w $width