Mercurial > vim
comparison src/misc2.c @ 7148:339e657a6ed6 v7.4.885
commit https://github.com/vim/vim/commit/c79a5452acd695238798947e40086f9823c400e7
Author: Bram Moolenaar <Bram@vim.org>
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 29 Sep 2015 12:15:04 +0200 |
parents | cc5570ed684e |
children | e036defe034e |
comparison
equal
deleted
inserted
replaced
7147:c590de398af9 | 7148:339e657a6ed6 |
---|---|
4367 { | 4367 { |
4368 wc_path = vim_strsave(search_ctx->ffsc_wc_path); | 4368 wc_path = vim_strsave(search_ctx->ffsc_wc_path); |
4369 temp = alloc((int)(STRLEN(search_ctx->ffsc_wc_path) | 4369 temp = alloc((int)(STRLEN(search_ctx->ffsc_wc_path) |
4370 + STRLEN(search_ctx->ffsc_fix_path + len) | 4370 + STRLEN(search_ctx->ffsc_fix_path + len) |
4371 + 1)); | 4371 + 1)); |
4372 if (temp == NULL || wc_path == NULL) | |
4373 { | |
4374 vim_free(buf); | |
4375 vim_free(temp); | |
4376 vim_free(wc_path); | |
4377 goto error_return; | |
4378 } | |
4379 | |
4380 STRCPY(temp, search_ctx->ffsc_fix_path + len); | |
4381 STRCAT(temp, search_ctx->ffsc_wc_path); | |
4382 vim_free(search_ctx->ffsc_wc_path); | |
4383 vim_free(wc_path); | |
4384 search_ctx->ffsc_wc_path = temp; | |
4372 } | 4385 } |
4373 | |
4374 if (temp == NULL || wc_path == NULL) | |
4375 { | |
4376 vim_free(buf); | |
4377 vim_free(temp); | |
4378 vim_free(wc_path); | |
4379 goto error_return; | |
4380 } | |
4381 | |
4382 STRCPY(temp, search_ctx->ffsc_fix_path + len); | |
4383 STRCAT(temp, search_ctx->ffsc_wc_path); | |
4384 vim_free(search_ctx->ffsc_wc_path); | |
4385 vim_free(wc_path); | |
4386 search_ctx->ffsc_wc_path = temp; | |
4387 } | 4386 } |
4388 #endif | 4387 #endif |
4389 vim_free(buf); | 4388 vim_free(buf); |
4390 } | 4389 } |
4391 | 4390 |