diff options
author | nfnty <git@nfnty.se> | 2017-02-01 23:07:59 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2017-02-01 23:07:59 +0100 |
commit | f495a97be986236f184b2a4f4edc5b451d409e72 (patch) | |
tree | 4ca21a064e8c939b206af711c82e7fb2f4e4ada9 | |
parent | 27d06bb96dffd36f37b25919c229927ca89d271d (diff) | |
download | ranger-f495a97be986236f184b2a4f4edc5b451d409e72.tar.gz |
config.commands.alias: Prohibit creation of alias with name 'alias'
Fixes #537
-rwxr-xr-x | ranger/config/commands.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py index f132e444..e7ddb200 100755 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -104,8 +104,13 @@ class alias(Command): def execute(self): if not self.arg(1) or not self.arg(2): self.fm.notify('Syntax: alias <newcommand> <oldcommand>', bad=True) - else: - self.fm.commands.alias(self.arg(1), self.rest(2)) + return + + if self.arg(1) == 'alias': + self.fm.notify("Can't create alias with name 'alias'", bad=True) + return + + self.fm.commands.alias(self.arg(1), self.rest(2)) class echo(Command): |