From d12460123e171c224f3aca3952f026590c935ad7 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Thu, 11 Feb 2016 22:44:36 +0100 Subject: vim-patch:7.4.885 Problem: When doing an upwards search without wildcards the search fails if the initial directory doesn't exist. Solution: Fix the non-wildcard case. (Stefan Kempf) https://github.com/vim/vim/commit/c79a5452acd695238798947e40086f9823c400e7 --- src/nvim/file_search.c | 19 ++++++------------- src/nvim/version.c | 2 +- 2 files changed, 7 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index b213a42c52..ca586b74d5 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -484,28 +484,21 @@ vim_findfile_init ( len = (int)(p - search_ctx->ffsc_fix_path) - 1; STRNCAT(ff_expand_buffer, search_ctx->ffsc_fix_path, len); add_pathsep((char *)ff_expand_buffer); - } else + } else { len = (int)STRLEN(search_ctx->ffsc_fix_path); + } if (search_ctx->ffsc_wc_path != NULL) { wc_path = vim_strsave(search_ctx->ffsc_wc_path); temp = xmalloc(STRLEN(search_ctx->ffsc_wc_path) + STRLEN(search_ctx->ffsc_fix_path + len) + 1); - } - - if (temp == NULL || wc_path == NULL) { - xfree(buf); - xfree(temp); + STRCPY(temp, search_ctx->ffsc_fix_path + len); + STRCAT(temp, search_ctx->ffsc_wc_path); + xfree(search_ctx->ffsc_wc_path); xfree(wc_path); - goto error_return; + search_ctx->ffsc_wc_path = temp; } - - STRCPY(temp, search_ctx->ffsc_fix_path + len); - STRCAT(temp, search_ctx->ffsc_wc_path); - xfree(search_ctx->ffsc_wc_path); - xfree(wc_path); - search_ctx->ffsc_wc_path = temp; } xfree(buf); } diff --git a/src/nvim/version.c b/src/nvim/version.c index 4b00349270..3c84d60019 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -403,7 +403,7 @@ static int included_patches[] = { // 888, // 887, // 886 NA - // 885, + 885, // 884 NA // 883, // 882, -- cgit