jovanbulck / jsh

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

Sourcing aliases may result in double alias definitions #40

Closed stefaantruijen closed 9 years ago

stefaantruijen commented 9 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 9 years ago

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

jovanbulck commented 9 years ago

Merged Thx!

GijsTimmers commented 9 years ago

stefaan is ne kaka