diff options
author | Singustromo <singustromo@disroot.org> | 2024-05-29 20:01:34 +0200 |
---|---|---|
committer | Singustromo <singustromo@disroot.org> | 2024-05-29 20:01:34 +0200 |
commit | 23c7052610a261258cc0edb5c908b3178fbcfe44 (patch) | |
tree | 8b6e712c6b455c47f8c77a948575a12b64446eb1 | |
parent | ae433f7515f4503e75a9be673b7c194e7101d552 (diff) | |
download | operating-systems_3_clash-master.tar.gz operating-systems_3_clash-master.zip |
-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; } /* |