summary refs log tree commit diff
diff options
context:
space:
mode:
authorSingustromo <singustromo@disroot.org>2024-05-29 20:01:34 +0200
committerSingustromo <singustromo@disroot.org>2024-05-29 20:01:34 +0200
commit23c7052610a261258cc0edb5c908b3178fbcfe44 (patch)
tree8b6e712c6b455c47f8c77a948575a12b64446eb1
parentae433f7515f4503e75a9be673b7c194e7101d552 (diff)
downloadoperating-systems_3_clash-23c7052610a261258cc0edb5c908b3178fbcfe44.tar.gz
operating-systems_3_clash-23c7052610a261258cc0edb5c908b3178fbcfe44.zip
conditional inversion HEAD master
-rw-r--r--src/clash.c11
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;
 }
 
 /*