about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-05-13 15:11:29 +0200
committerhut <hut@lavabit.com>2010-05-13 15:11:41 +0200
commit80d26787cac7b2655689dd7ba007c2b18f98c528 (patch)
tree1b75731c9199e58b24bcf7e3937d47099f994d6f
parent1903181524726664744f807d909ddc7687f8c0cf (diff)
downloadranger-80d26787cac7b2655689dd7ba007c2b18f98c528.tar.gz
main: strip off leading "file://" in filenames
Mainly for compatibility with "open with.." programs which
prepend a file://, like firefox
-rw-r--r--ranger/__main__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ranger/__main__.py b/ranger/__main__.py
index 3bb857c3..32ea729c 100644
--- a/ranger/__main__.py
+++ b/ranger/__main__.py
@@ -175,6 +175,8 @@ def main():
 
 	if arg.targets:
 		target = arg.targets[0]
+		if target.startswith('file://'):
+			target = target[7:]
 		if not os.access(target, os.F_OK):
 			print("File or directory doesn't exist: %s" % target)
 			sys.exit(1)