From 2842773aa53a1008c9d9fcb17a3ce49fdfbde907 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 28 Apr 2007 21:34:54 +0000 Subject: [PATCH] Added support for changing the host platform cwd to the cd command. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20888 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tools/fs_shell/fssh.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tools/fs_shell/fssh.cpp b/src/tools/fs_shell/fssh.cpp index 449ca45ea3..ae4ed65575 100644 --- a/src/tools/fs_shell/fssh.cpp +++ b/src/tools/fs_shell/fssh.cpp @@ -17,6 +17,7 @@ #include "command_cp.h" #include "fd.h" #include "fssh_dirent.h" +#include "fssh_errno.h" #include "fssh_errors.h" #include "fssh_module.h" #include "fssh_stat.h" @@ -249,7 +250,13 @@ command_cd(int argc, const char* const* argv) } const char* directory = argv[1]; - fssh_status_t error = _kern_setcwd(-1, directory); + fssh_status_t error = FSSH_B_OK; + if (directory[0] == ':') { + if (chdir(directory + 1) < 0) + error = fssh_get_errno(); + } else + error = _kern_setcwd(-1, directory); + if (error != FSSH_B_OK) { fprintf(stderr, "Error: cd %s: %s\n", directory, fssh_strerror(error)); return error;