Quellcode durchsuchen

get_pwd_full() doesn't stop on empty 'line' field

Serj Kalichev vor 6 Jahren
Ursprung
Commit
67e3a7add5
1 geänderte Dateien mit 2 neuen und 5 gelöschten Zeilen
  1. 2 5
      clish/shell/shell_pwd.c

+ 2 - 5
clish/shell/shell_pwd.c

@@ -140,11 +140,8 @@ char *clish_shell__get_pwd_full(const clish_shell_t * this, unsigned int depth)
 	for (i = 1; i <= depth; i++) {
 		const char *str =
 			clish_shell__get_pwd_line(this, i);
-		/* Cannot get full path */
-		if (!str) {
-			lub_string_free(pwd);
-			return NULL;
-		}
+		if (!str)
+			continue;
 		if (pwd)
 			lub_string_cat(&pwd, " ");
 		lub_string_cat(&pwd, "\"");