jovanbulck / jsh

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

cd - doesn't work #34

Closed GijsTimmers closed 9 years ago

GijsTimmers commented 9 years ago

Normally, cd - gets you in the previous directory.

Expected behaviour:

$ pwd
  /etc/apt
$ cd /mnt/Data
$ pwd
  /mnt/Data
$ cd -
$ pwd
  /etc/apt

Actual behaviour:

$ pwd
  /etc/apt
$ cd /mnt/Data
$ pwd
  /mnt/Data
$ cd -
  [DEBUG: You entered: 'cd -']
  [DEBUG: readcmd: cmd 'cd -' expanded to 'cd -']
  [DEBUG: alias: input resolved to: 'cd -']
  jsh: cd: No such file or directory
  [DEBUG: built-in: executed 'cd']
  [DEBUG: freeing comd struct for 'cd']
  [DEBUG: parseexpr: expr evaluated with return value 1]
  [DEBUG: readcmd: freeing memory for: 'cd']
$ pwd
  /mnt/Data
GijsTimmers commented 9 years ago

See #33.