diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-07-22 15:24:56 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-07-22 15:24:56 -0400 |
commit | ba04a1c30674523fb7880b3003d8087ed7852cd9 (patch) | |
tree | bd9347f6efe81084eb4b703f6f5b6bbbaccffdc4 /src/nvim/ex_cmds.c | |
parent | 845d1bfa905cf0d28d9a1a662e42525449dd1be4 (diff) | |
parent | 7a2ea275eb5964f4a9b875ca273068fb9b40c81d (diff) | |
download | rneovim-ba04a1c30674523fb7880b3003d8087ed7852cd9.tar.gz rneovim-ba04a1c30674523fb7880b3003d8087ed7852cd9.tar.bz2 rneovim-ba04a1c30674523fb7880b3003d8087ed7852cd9.zip |
Merge pull request #904 from war1025/dev/buffer_tests
Add unit tests for buffer.c and fileio.c
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 384eebe556..c516b24236 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -5156,7 +5156,11 @@ void fix_help_buffer(void) /* Find all "doc/ *.txt" files in this directory. */ add_pathsep(NameBuff); STRCAT(NameBuff, "doc/*.??[tx]"); - if (gen_expand_wildcards(1, &NameBuff, &fcount, + + // Note: We cannot just do `&NameBuff` because it is a statically sized array + // so `NameBuff == &NameBuff` according to C semantics. + char_u *buff_list[1] = {(char_u*) NameBuff}; + if (gen_expand_wildcards(1, buff_list, &fcount, &fnames, EW_FILE|EW_SILENT) == OK && fcount > 0) { int i1; @@ -5324,7 +5328,11 @@ void ex_helptags(exarg_T *eap) STRCPY(NameBuff, dirname); add_pathsep(NameBuff); STRCAT(NameBuff, "**"); - if (gen_expand_wildcards(1, &NameBuff, &filecount, &files, + + // Note: We cannot just do `&NameBuff` because it is a statically sized array + // so `NameBuff == &NameBuff` according to C semantics. + char_u *buff_list[1] = {(char_u*) NameBuff}; + if (gen_expand_wildcards(1, buff_list, &filecount, &files, EW_FILE|EW_SILENT) == FAIL || filecount == 0) { EMSG2("E151: No match: %s", NameBuff); @@ -5422,7 +5430,11 @@ helptags_one ( STRCPY(NameBuff, dir); STRCAT(NameBuff, "/**/*"); STRCAT(NameBuff, ext); - if (gen_expand_wildcards(1, &NameBuff, &filecount, &files, + + // Note: We cannot just do `&NameBuff` because it is a statically sized array + // so `NameBuff == &NameBuff` according to C semantics. + char_u *buff_list[1] = {(char_u*) NameBuff}; + if (gen_expand_wildcards(1, buff_list, &filecount, &files, EW_FILE|EW_SILENT) == FAIL || filecount == 0) { if (!got_int) |