diff options
author | Jurica Bradaric <jbradaric@gmail.com> | 2016-02-28 13:26:10 +0100 |
---|---|---|
committer | Jurica Bradaric <jbradaric@gmail.com> | 2016-04-20 08:25:51 +0200 |
commit | 425fcdb5b4bc6dec05dafe2e2675c8a7cfe37187 (patch) | |
tree | 6aa7ad9c977e9a678ffd595f96873866610493f9 /src | |
parent | 29b737e92b5865918ca1e8c5a30e6c6f3a351915 (diff) | |
download | rneovim-425fcdb5b4bc6dec05dafe2e2675c8a7cfe37187.tar.gz rneovim-425fcdb5b4bc6dec05dafe2e2675c8a7cfe37187.tar.bz2 rneovim-425fcdb5b4bc6dec05dafe2e2675c8a7cfe37187.zip |
vim-patch:7.4.1120
Problem: delete(x, 'rf') fails if a directory is empty. (Lcd)
Solution: Ignore not finding matches in an empty directory.
https://github.com/vim/vim/commit/336bd622c31e1805495c034e1a8cfadcc0bbabc7
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/path.c | 2 | ||||
-rw-r--r-- | src/nvim/path.h | 1 | ||||
-rw-r--r-- | src/nvim/tempfile.c | 4 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c index a6e8aa6236..d3df9bc059 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -1223,7 +1223,7 @@ int gen_expand_wildcards(int num_pat, char_u **pat, int *num_file, recursive = false; - return (ga.ga_data != NULL) ? OK : FAIL; + return ((flags & EW_EMPTYOK) || ga.ga_data != NULL) ? OK : FAIL; } diff --git a/src/nvim/path.h b/src/nvim/path.h index 9574d8131f..88e5935c24 100644 --- a/src/nvim/path.h +++ b/src/nvim/path.h @@ -22,6 +22,7 @@ * is used when executing commands and EW_SILENT for interactive expanding. */ #define EW_ALLLINKS 0x1000 // also links not pointing to existing file #define EW_DODOT 0x4000 // also files starting with a dot +#define EW_EMPTYOK 0x8000 // no matches is not an error /// Return value for the comparison of two files. Also @see path_full_compare. typedef enum file_comparison { diff --git a/src/nvim/tempfile.c b/src/nvim/tempfile.c index 3b1a2ffca6..c7881fd9a5 100644 --- a/src/nvim/tempfile.c +++ b/src/nvim/tempfile.c @@ -70,8 +70,8 @@ int delete_recursive(char_u *name) int file_count; char_u *exp = vim_strsave(NameBuff); if (gen_expand_wildcards(1, &exp, &file_count, &files, - EW_DIR | EW_FILE | EW_SILENT - | EW_ALLLINKS | EW_DODOT) == OK) { + EW_DIR | EW_FILE | EW_SILENT | EW_ALLLINKS + | EW_DODOT | EW_EMPTYOK) == OK) { for (int i = 0; i < file_count; i++) { if (delete_recursive(files[i]) != 0) { result = -1; diff --git a/src/nvim/version.c b/src/nvim/version.c index 3276439c50..ca7438e708 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -244,7 +244,7 @@ static int included_patches[] = { // 1123, // 1122 NA // 1121, - // 1120, + 1120, // 1119, // 1118, 1117, |