To: vim_dev@googlegroups.com Subject: Patch 8.0.1666 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1666 Problem: % argument in ch_log() causes trouble. Solution: Use string as third argument in internal ch_log(). (Dominique Pelle, closes #2784) Files: src/evalfunc.c, src/testdir/test_channel.vim *** ../vim-8.0.1665/src/evalfunc.c 2018-03-29 16:03:46.616035925 +0200 --- src/evalfunc.c 2018-04-05 22:42:25.544130943 +0200 *************** *** 1993,1999 **** if (argvars[1].v_type != VAR_UNKNOWN) channel = get_channel_arg(&argvars[1], FALSE, FALSE, 0); ! ch_log(channel, (char *)msg); } /* --- 1993,1999 ---- if (argvars[1].v_type != VAR_UNKNOWN) channel = get_channel_arg(&argvars[1], FALSE, FALSE, 0); ! ch_log(channel, "%s", msg); } /* *************** *** 12927,12933 **** } /* ! * Unref/free "callback" and "partial" retured by get_callback(). */ void free_callback(char_u *callback, partial_T *partial) --- 12927,12933 ---- } /* ! * Unref/free "callback" and "partial" returned by get_callback(). */ void free_callback(char_u *callback, partial_T *partial) *** ../vim-8.0.1665/src/testdir/test_channel.vim 2018-02-27 19:09:56.711821176 +0100 --- src/testdir/test_channel.vim 2018-04-05 22:37:28.945741409 +0200 *************** *** 1823,1825 **** --- 1823,1837 ---- call s:test_list_args('print("hello\"world\"")', 'hello"world"', 1) call s:test_list_args('print("hello\tworld")', "hello\tworld", 1) endfunc + + " Do this last, it stops any channel log. + func Test_zz_ch_log() + call ch_logfile('Xlog', 'w') + call ch_log('hello there') + call ch_log('%s%s') + call ch_logfile('') + let text = readfile('Xlog') + call assert_match("hello there", text[1]) + call assert_match("%s%s", text[2]) + call delete('Xlog') + endfunc *** ../vim-8.0.1665/src/version.c 2018-04-05 22:15:18.044339136 +0200 --- src/version.c 2018-04-05 22:25:51.557267731 +0200 *************** *** 764,765 **** --- 764,767 ---- { /* Add new patch number below this line */ + /**/ + 1666, /**/ -- hundred-and-one symptoms of being an internet addict: 108. While reading a magazine, you look for the Zoom icon for a better look at a photograph. /// Bram Moolenaar -- Bram@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 ///