Skip to content

Commit

Permalink
[FELIX-6191] [gogo][jline] The cd command should normalize the directory
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Oct 16, 2019
1 parent e95b2c1 commit 1bb3f42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion demo/src/main/java/org/apache/felix/gogo/jline/Posix.java
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ protected void cd(CommandSession session, Process process, String[] argv) throws
throw new IllegalArgumentException("usage: cd DIRECTORY");
}
Path cwd = session.currentDir();
cwd = cwd.resolve(opt.args().get(0)).toAbsolutePath();
cwd = cwd.resolve(opt.args().get(0)).toAbsolutePath().normalize();
if (!Files.exists(cwd)) {
throw new IOException("no such file or directory: " + opt.args().get(0));
} else if (!Files.isDirectory(cwd)) {
Expand Down

0 comments on commit 1bb3f42

Please sign in to comment.