From f495a97be986236f184b2a4f4edc5b451d409e72 Mon Sep 17 00:00:00 2001 From: nfnty Date: Wed, 1 Feb 2017 23:07:59 +0100 Subject: config.commands.alias: Prohibit creation of alias with name 'alias' Fixes #537 --- ranger/config/commands.py | 9 +++++++-- 1 file 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 ', 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): -- cgit 1.4.1-2-gfad0