Просмотр исходного кода

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

Serj Kalichev 5 лет назад
Родитель
Сommit
67e3a7add5
1 измененных файлов с 2 добавлено и 5 удалено
  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++) {
 	for (i = 1; i <= depth; i++) {
 		const char *str =
 		const char *str =
 			clish_shell__get_pwd_line(this, i);
 			clish_shell__get_pwd_line(this, i);
-		/* Cannot get full path */
-		if (!str) {
-			lub_string_free(pwd);
-			return NULL;
-		}
+		if (!str)
+			continue;
 		if (pwd)
 		if (pwd)
 			lub_string_cat(&pwd, " ");
 			lub_string_cat(&pwd, " ");
 		lub_string_cat(&pwd, "\"");
 		lub_string_cat(&pwd, "\"");