jovanbulck / jsh

A basic UNIX shell implementation in C
GNU General Public License v3.0
31 stars 10 forks source link

Sourcing aliases may result in double alias definitions #40

Closed stefaantruijen closed 10 years ago

stefaantruijen commented 10 years ago

Current behaviour: Suppose the following alias is defined: ll='ls -la'. Suppose ~/.jshrc contains the instruction: alias ll "ls -l"

$ alias
alias ll="ls -la"
$ source ~/.jshrc
$ alias
alias ll="ls -la"
alias ll="ls-l"

According to POSIX, in the case of a double aliasdefinition, the older alias should be overwritten with the newer one.

Expected behaviour:

$ alias
alias ll="ls -la"
$ source ~/.jshrc
$ alias
alias ll="ls -l"
stefaantruijen commented 10 years ago

I resolved the issue. Check out the pull-request ;)

jovanbulck commented 10 years ago

Merged Thx!

GijsTimmers commented 10 years ago

stefaan is ne kaka