diff options
-rw-r--r-- | src/clash.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/clash.c b/src/clash.c index be1bd2f..9bbe2d0 100644 --- a/src/clash.c +++ b/src/clash.c @@ -12,7 +12,7 @@ #define PROMPTSIZE 1337 #define TOKEN_BUFFERSIZE 50 -#define TOKEN_DELIMITER "\n\t " // do not include new line +#define TOKEN_DELIMITER "\n\t " // we also do not include new line static int getline_skew(char *buffer, size_t limit); @@ -129,12 +129,11 @@ static void print_prompt(char *current_path, int child_exitcode, int job_count) } static bool update_current_path(char *path) { - if (getcwd(path, PATH_MAX) == NULL) { - perror("[!] unable to get current working directory"); - return false; - } + if (getcwd(path, PATH_MAX) != NULL) + return true; - return true; + perror("[!] unable to get current working directory"); + return false; } /* |