Skip to content

Commit eed8d7c

Browse files
author
kernelsmith
committed
fix ^alias regex and mispelling in comments
/^alias/i needed to be /^alias$/i (thanks bperry)
1 parent 8c864ef commit eed8d7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/alias.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def cmd_alias(*args)
8585
# We prevent the user from naming the alias "alias" cuz they could end up unable to clear the aliases,
8686
# for example you 'alias -f set unset and then 'alias -f alias sessions', now you're screwed. The byproduct
8787
# of this is that it prevents you from aliasing 'alias' to 'alias -f' etc, but that's acceptable
88-
reserved_words = [/^alias/i]
88+
reserved_words = [/^alias$/i]
8989
reserved_words.each do |regex|
9090
if name =~ regex
9191
print_error "You cannot use #{name} as the name for an alias, sorry"
@@ -113,7 +113,7 @@ def cmd_alias(*args)
113113
# smash everything that's left together
114114
value = args.join(" ")
115115
value.strip!
116-
# valule can NEVER be certain bad words like 'rm -rf /', add any other reserved words here
116+
# value can NEVER be certain bad words like 'rm -rf /', add any other reserved words here
117117
# this is basic idiot protection, not meant to be impervious to subversive intentions
118118
reserved_words = [/^rm +(-rf|-r +-f|-f +-r) +\/.*$/]
119119
reserved_words.each do |regex|

0 commit comments

Comments
 (0)