# HG changeset patch # User Christian Brabandt # Date 1443521704 -7200 # Node ID 339e657a6ed6bc400c729c93a2d8ad02f4fe7876 # Parent c590de398af939fac189826c9d7a3c7fa609ba24 commit https://github.com/vim/vim/commit/c79a5452acd695238798947e40086f9823c400e7 Author: Bram Moolenaar Date: Tue Sep 29 12:08:42 2015 +0200 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) diff --git a/src/misc2.c b/src/misc2.c --- a/src/misc2.c +++ b/src/misc2.c @@ -4369,21 +4369,20 @@ vim_findfile_init(path, filename, stopdi temp = alloc((int)(STRLEN(search_ctx->ffsc_wc_path) + STRLEN(search_ctx->ffsc_fix_path + len) + 1)); - } - - if (temp == NULL || wc_path == NULL) - { - vim_free(buf); - vim_free(temp); + if (temp == NULL || wc_path == NULL) + { + vim_free(buf); + vim_free(temp); + vim_free(wc_path); + goto error_return; + } + + STRCPY(temp, search_ctx->ffsc_fix_path + len); + STRCAT(temp, search_ctx->ffsc_wc_path); + vim_free(search_ctx->ffsc_wc_path); vim_free(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); - vim_free(search_ctx->ffsc_wc_path); - vim_free(wc_path); - search_ctx->ffsc_wc_path = temp; } #endif vim_free(buf); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 885, +/**/ 884, /**/ 883,