From 9ab9f65217df8dd75e171702bee2943ca295e956 Mon Sep 17 00:00:00 2001 From: David Pugnasse Date: Tue, 25 Oct 2011 02:15:53 +0200 Subject: core.main: fix --selectfile with relative paths --- ranger/core/actions.py | 8 ++------ ranger/core/main.py | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index 3300a534..5364f391 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -344,12 +344,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): def select_file(self, path): path = path.strip() - dirname = os.path.dirname(path) - if dirname: - if self.enter_dir(dirname): - self.env.cwd.move_to_obj(path) - else: - self.env.cwd.move_to_obj(join(self.env.cwd.path, path)) + if self.enter_dir(os.path.dirname(path)): + self.env.cwd.move_to_obj(path) def history_go(self, relative): """Move back and forth in the history""" diff --git a/ranger/core/main.py b/ranger/core/main.py index 49513125..14e4b1f6 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -50,6 +50,7 @@ def main(): SettingsAware._setup(clean=arg.clean) if arg.selectfile: + arg.selectfile = os.path.abspath(arg.selectfile) arg.targets.insert(0, os.path.dirname(arg.selectfile)) targets = arg.targets or ['.'] -- cgit 1.4.1-2-gfad0