diff options
-rw-r--r-- | ranger/core/actions.py | 8 | ||||
-rw-r--r-- | 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 ['.'] |