Patch 8.1.2187

17 views
Skip to first unread message

Bram Moolenaar

unread,
Oct 19, 2019, 3:01:45 PM10/19/19
to vim...@googlegroups.com

Patch 8.1.2187
Problem: Error for bad regexp even though regexp is not used when writing
a file. (Arseny Nasokin)
Solution: Ignore regexp errors. (closes #5059)
Files: src/cmdexpand.c, src/ex_docmd.c, src/testdir/test_writefile.vim


*** ../vim-8.1.2186/src/cmdexpand.c 2019-08-25 15:40:39.658739525 +0200
--- src/cmdexpand.c 2019-10-19 20:45:12.123133046 +0200
***************
*** 1976,1981 ****
--- 1976,1983 ----
flags |= EW_KEEPALL;
if (options & WILD_SILENT)
flags |= EW_SILENT;
+ if (options & WILD_NOERROR)
+ flags |= EW_NOERROR;
if (options & WILD_ALLLINKS)
flags |= EW_ALLLINKS;

*** ../vim-8.1.2186/src/ex_docmd.c 2019-10-18 20:53:30.697741631 +0200
--- src/ex_docmd.c 2019-10-19 20:53:43.044943051 +0200
***************
*** 4211,4217 ****
else /* n == 2 */
{
expand_T xpc;
! int options = WILD_LIST_NOTFOUND|WILD_ADD_SLASH;

ExpandInit(&xpc);
xpc.xp_context = EXPAND_FILES;
--- 4211,4218 ----
else /* n == 2 */
{
expand_T xpc;
! int options = WILD_LIST_NOTFOUND
! | WILD_NOERROR | WILD_ADD_SLASH;

ExpandInit(&xpc);
xpc.xp_context = EXPAND_FILES;
*** ../vim-8.1.2186/src/testdir/test_writefile.vim 2019-05-31 20:42:04.690287097 +0200
--- src/testdir/test_writefile.vim 2019-10-19 20:53:13.793051153 +0200
***************
*** 1,4 ****
! " Tests for the writefile() function.

func Test_writefile()
let f = tempname()
--- 1,4 ----
! " Tests for the writefile() function and some :write commands.

func Test_writefile()
let f = tempname()
***************
*** 16,21 ****
--- 16,26 ----
call delete(f)
endfunc

+ func Test_writefile_ignore_regexp_error()
+ write Xt[z-a]est.txt
+ call delete('Xt[z-a]est.txt')
+ endfunc
+
func Test_writefile_fails_gently()
call assert_fails('call writefile(["test"], "Xfile", [])', 'E730:')
call assert_false(filereadable("Xfile"))
*** ../vim-8.1.2186/src/version.c 2019-10-19 20:57:24.956093733 +0200
--- src/version.c 2019-10-19 21:00:05.991452059 +0200
***************
*** 743,744 ****
--- 743,746 ----
{ /* Add new patch number below this line */
+ /**/
+ 2187,
/**/

--
Kiss me twice. I'm schizophrenic.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

tooth pik

unread,
Oct 19, 2019, 3:10:44 PM10/19/19
to vim...@googlegroups.com
i can't build after applying this patch:

cmdexpand.c: In function ‘ExpandFromContext’:
cmdexpand.c:1979:19: error: ‘WILD_NOERROR’ undeclared (first use in
this function); did you mean ‘FIND_NOERROR’?
if (options & WILD_NOERROR)
^~~~~~~~~~~~
FIND_NOERROR
cmdexpand.c:1979:19: note: each undeclared identifier is reported only
once for each function it appears in
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201910191901.x9JJ1bir011399%40masaka.moolenaar.net.
Reply all
Reply to author
Forward
0 new messages