Re: Patch 9.0.0419

2022-09-08 Fir de Conversatie Bram Moolenaar


> On 09-Sept-2022 04:53, Bram Moolenaar wrote:
> > Patch 9.0.0419
> > Problem:The :defer command does not check the function argument count 
> > and
> >  types.
> > Solution:   Check the function arguments when adding a deferred function.
> > Files:  src/userfunc.c, src/vim9instr.c, src/proto/vim9instr.pro,
> >  src/vim9cmds.c, src/testdir/test_user_func.vim
> >
> After this patch mingw64 (gcc 12.2.0) spits out this linker error:
> 
> gcc -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 
> -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO 
> -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return 
> -fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD -Wl,-nxcompat,-dynamicbase 
> -municode -s -mwindows -o gvim.exe gobjnative/alloc.o 
> gobjnative/arabic.o gobjnative/arglist.o gobjnative/autocmd.o 

[...]

> d:/users/john/documents/software/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
>  
> gobjnative/vim9cmds.o:vim9cmds.c:(.text+0x2628): undefined reference to 
> `get_defer_var_idx'
> d:/users/john/documents/software/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
>  
> gobjnative/vim9expr.o:vim9expr.c:(.text+0x5a9d): undefined reference to 
> `get_defer_var_idx'
> collect2.exe: error: ld returned 1 exit status
> make: *** [Make_cyg_ming.mak:1137: gvim.exe] Error 1
> 
> 
> This patch removed the function but not all of the calls.

Weird, that function should not have been removed.  And it wasn't in my
main directory and a shadow directory (all tests passed locally).  But
it delete in the diff and in the git repo.  Can't explain it.

> Also, it looks like the contents of patch 9.0.0418 are the same as 9.0.0419.

Wrong diff in the email...  I'll reply.

-- 
"Space is big.  Really big.  You just won't believe how vastly hugely mind-
bogglingly big it is.  I mean, you may think it's a long way down the
road to the chemist, but that's just peanuts to space."
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220908195745.8BE001C0B04%40moolenaar.net.


Patch 9.0.0418

2022-09-08 Fir de Conversatie Bram Moolenaar


I wrote:

> Patch 9.0.0418
> Problem:Manually deleting temp test files.
> Solution:   Use the 'D' flag of writefile() and mkdir().
> Files:  src/testdir/test_cd.vim, src/testdir/test_changelist.vim,
> src/testdir/test_channel.vim, src/testdir/test_checkpath.vim,
> src/testdir/test_cmdline.vim, src/testdir/test_cmdwin.vim,
> src/testdir/test_conceal.vim, src/testdir/test_cpoptions.vim,
> src/testdir/test_cscope.vim, src/testdir/test_cursorline.vim
> 
> 
> *** ../vim-9.0.0418/src/userfunc.c2022-09-07 21:30:40.139379052 +0100
> --- src/userfunc.c2022-09-08 18:11:09.503285696 +0100

That's the wrong diff.  This should be the right one:


*** ../vim-9.0.0417/src/testdir/test_cd.vim 2022-08-29 22:31:15.919685279 
+0100
--- src/testdir/test_cd.vim 2022-09-08 16:33:06.829221261 +0100
***
*** 58,75 
  call writefile(v:errors, 'Xresult')
  qall!
[SCRIPT]
!   call writefile(lines, 'Xscript')
if RunVim([], [], '--clean -S Xscript')
  call assert_equal([], readfile('Xresult'))
endif
-   call delete('Xscript')
call delete('Xresult')
  endfunc
  
  " Test for chdir()
  func Test_chdir_func()
let topdir = getcwd()
!   call mkdir('Xchdir/y/z', 'p')
  
" Create a few tabpages and windows with different directories
new
--- 58,74 
  call writefile(v:errors, 'Xresult')
  qall!
[SCRIPT]
!   call writefile(lines, 'Xscript', 'D')
if RunVim([], [], '--clean -S Xscript')
  call assert_equal([], readfile('Xresult'))
endif
call delete('Xresult')
  endfunc
  
  " Test for chdir()
  func Test_chdir_func()
let topdir = getcwd()
!   call mkdir('Xchdir/y/z', 'pR')
  
" Create a few tabpages and windows with different directories
new
***
*** 110,122 
  
only | tabonly
call chdir(topdir)
-   call delete('Xchdir', 'rf')
  endfunc
  
  " Test for changing to the previous directory '-'
  func Test_prev_dir()
let topdir = getcwd()
!   call mkdir('Xprevdir/a/b/c', 'p')
  
" Create a few tabpages and windows with different directories
new | only
--- 109,120 
  
only | tabonly
call chdir(topdir)
  endfunc
  
  " Test for changing to the previous directory '-'
  func Test_prev_dir()
let topdir = getcwd()
!   call mkdir('Xprevdir/a/b/c', 'pR')
  
" Create a few tabpages and windows with different directories
new | only
***
*** 173,179 
  
only | tabonly
call chdir(topdir)
-   call delete('Xprevdir', 'rf')
  endfunc
  
  func Test_lcd_split()
--- 171,176 
***
*** 201,222 
  endfunc
  
  func Test_cd_completion()
!   call mkdir('XComplDir1', 'p')
!   call mkdir('XComplDir2', 'p')
!   call writefile([], 'XComplFile')
  
for cmd in ['cd', 'chdir', 'lcd', 'lchdir', 'tcd', 'tchdir']
  call feedkeys(':' .. cmd .. " XCompl\\\"\", 'tx')
  call assert_equal('"' .. cmd .. ' XComplDir1/ XComplDir2/', @:)
endfor
- 
-   call delete('XComplDir1', 'd')
-   call delete('XComplDir2', 'd')
-   call delete('XComplFile')
  endfunc
  
  func Test_cd_unknown_dir()
!   call mkdir('Xa')
cd Xa
call writefile(['text'], 'Xb.txt')
edit Xa/Xb.txt
--- 198,215 
  endfunc
  
  func Test_cd_completion()
!   call mkdir('XComplDir1', 'D')
!   call mkdir('XComplDir2', 'D')
!   call writefile([], 'XComplFile', 'D')
  
for cmd in ['cd', 'chdir', 'lcd', 'lchdir', 'tcd', 'tchdir']
  call feedkeys(':' .. cmd .. " XCompl\\\"\", 'tx')
  call assert_equal('"' .. cmd .. ' XComplDir1/ XComplDir2/', @:)
endfor
  endfunc
  
  func Test_cd_unknown_dir()
!   call mkdir('Xa', 'R')
cd Xa
call writefile(['text'], 'Xb.txt')
edit Xa/Xb.txt
***
*** 229,242 
  
bwipe!
exe "bwipe! " .. first_buf
-   call delete('Xa', 'rf')
  endfunc
  
  func Test_getcwd_actual_dir()
CheckOption autochdir
  
let startdir = getcwd()
!   call mkdir('Xactual')
call test_autochdir()
set autochdir
edit Xactual/file.txt
--- 222,234 
  
bwipe!
exe "bwipe! " .. first_buf
  endfunc
  
  func Test_getcwd_actual_dir()
CheckOption autochdir
  
let startdir = getcwd()
!   call mkdir('Xactual', 'R')
call test_autochdir()
set autochdir
edit Xactual/file.txt
***
*** 250,256 
set noautochdir
bwipe!
call chdir(startdir)
-   call delete('Xactual', 'rf')
  endfunc
  
  " vim: shiftwidth=2 sts=2 expandtab
--- 242,247 
*** ../vim-9.0.0417/src/testdir/test_changelist.vim 2022-08-30 
21:46:03.65721 +0100
--- src/testdir/test_changelist.vim 2022-09-08 16:33:49.105193035 +0100
***
*** 64,71 
call assert_equal([], 10->getchangelist())
call assert_equal([[], 0], getchangelist())
  
!   call writefile(['line1', 'line2', 'line3'], 'Xclistfile1.txt')
!   call writefile(['line1', 'line2', 'line3'], 'Xclistfile2.txt')
  
edit Xclistfile1.txt
let buf_1 = bufnr()
--- 64,71 

Patch 9.0.0420

2022-09-08 Fir de Conversatie Bram Moolenaar


Patch 9.0.0420 (after 9.0.0419)
Problem:Function went missing.
Solution:   Add the function back.
Files:  src/vim9cmds.c


*** ../vim-9.0.0419/src/vim9cmds.c  2022-09-08 20:48:39.972666986 +0100
--- src/vim9cmds.c  2022-09-08 19:35:10.052887004 +0100
***
*** 1685,1690 
--- 1685,1711 
  }
  
  /*
+  * Get the local variable index for deferred function calls.
+  * Reserve it when not done already.
+  * Returns zero for failure.
+  */
+ int
+ get_defer_var_idx(cctx_T *cctx)
+ {
+ dfunc_T   *dfunc = ((dfunc_T *)def_functions.ga_data)
+  + cctx->ctx_ufunc->uf_dfunc_idx;
+ if (dfunc->df_defer_var_idx == 0)
+ {
+   lvar_T *lvar = reserve_local(cctx, (char_u *)"@defer@", 7,
+   TRUE, _list_any);
+   if (lvar == NULL)
+   return 0;
+   dfunc->df_defer_var_idx = lvar->lv_idx + 1;
+ }
+ return dfunc->df_defer_var_idx;
+ }
+ 
+ /*
   * Compile "defer func(arg)".
   */
  char_u *
*** ../vim-9.0.0419/src/version.c   2022-09-08 19:51:39.734308338 +0100
--- src/version.c   2022-09-08 20:44:54.744854615 +0100
***
*** 705,706 
--- 705,708 
  {   /* Add new patch number below this line */
+ /**/
+ 420,
  /**/

-- 
I'm not familiar with this proof, but I'm aware of a significant
following of toddlers who believe that peanut butter is the solution
to all of life's problems...-- Tim Hammerquist

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220908195136.660B71C0B04%40moolenaar.net.


Re: Patch 9.0.0419

2022-09-08 Fir de Conversatie John Marriott

On 09-Sept-2022 04:53, Bram Moolenaar wrote:

Patch 9.0.0419
Problem:The :defer command does not check the function argument count and
 types.
Solution:   Check the function arguments when adding a deferred function.
Files:  src/userfunc.c, src/vim9instr.c, src/proto/vim9instr.pro,
 src/vim9cmds.c, src/testdir/test_user_func.vim


After this patch mingw64 (gcc 12.2.0) spits out this linker error:

gcc -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO 
-pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return 
-fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD -Wl,-nxcompat,-dynamicbase 
-municode -s -mwindows -o gvim.exe gobjnative/alloc.o 
gobjnative/arabic.o gobjnative/arglist.o gobjnative/autocmd.o 
gobjnative/beval.o gobjnative/blob.o gobjnative/blowfish.o 
gobjnative/buffer.o gobjnative/bufwrite.o gobjnative/change.o 
gobjnative/charset.o gobjnative/cindent.o gobjnative/clientserver.o 
gobjnative/clipboard.o gobjnative/cmdexpand.o gobjnative/cmdhist.o 
gobjnative/crypt.o gobjnative/crypt_zip.o gobjnative/debugger.o 
gobjnative/dict.o gobjnative/diff.o gobjnative/digraph.o 
gobjnative/drawline.o gobjnative/drawscreen.o gobjnative/edit.o 
gobjnative/eval.o gobjnative/evalbuffer.o gobjnative/evalfunc.o 
gobjnative/evalvars.o gobjnative/evalwindow.o gobjnative/ex_cmds.o 
gobjnative/ex_cmds2.o gobjnative/ex_docmd.o gobjnative/ex_eval.o 
gobjnative/ex_getln.o gobjnative/fileio.o gobjnative/filepath.o 
gobjnative/findfile.o gobjnative/float.o gobjnative/fold.o 
gobjnative/getchar.o gobjnative/gui_xim.o gobjnative/hardcopy.o 
gobjnative/hashtab.o gobjnative/help.o gobjnative/highlight.o 
gobjnative/if_cscope.o gobjnative/indent.o gobjnative/insexpand.o 
gobjnative/json.o gobjnative/list.o gobjnative/locale.o 
gobjnative/main.o gobjnative/map.o gobjnative/mark.o gobjnative/match.o 
gobjnative/memfile.o gobjnative/memline.o gobjnative/menu.o 
gobjnative/message.o gobjnative/misc1.o gobjnative/misc2.o 
gobjnative/mouse.o gobjnative/move.o gobjnative/mbyte.o 
gobjnative/normal.o gobjnative/ops.o gobjnative/option.o 
gobjnative/optionstr.o gobjnative/os_mswin.o gobjnative/os_win32.o 
gobjnative/pathdef.o gobjnative/popupmenu.o gobjnative/popupwin.o 
gobjnative/profiler.o gobjnative/quickfix.o gobjnative/regexp.o 
gobjnative/register.o gobjnative/scriptfile.o gobjnative/screen.o 
gobjnative/search.o gobjnative/session.o gobjnative/sha256.o 
gobjnative/sign.o gobjnative/spell.o gobjnative/spellfile.o 
gobjnative/spellsuggest.o gobjnative/strings.o gobjnative/syntax.o 
gobjnative/tag.o gobjnative/term.o gobjnative/testing.o 
gobjnative/textformat.o gobjnative/textobject.o gobjnative/textprop.o 
gobjnative/time.o gobjnative/typval.o gobjnative/ui.o gobjnative/undo.o 
gobjnative/usercmd.o gobjnative/userfunc.o gobjnative/version.o 
gobjnative/vim9cmds.o gobjnative/vim9compile.o gobjnative/vim9execute.o 
gobjnative/vim9expr.o gobjnative/vim9instr.o gobjnative/vim9script.o 
gobjnative/vim9type.o gobjnative/viminfo.o gobjnative/winclip.o 
gobjnative/window.o gobjnative/os_w32exe.o gobjnative/vimres.o 
gobjnative/xdiffi.o gobjnative/xemit.o gobjnative/xprepare.o 
gobjnative/xutils.o gobjnative/xhistogram.o gobjnative/xpatience.o 
gobjnative/gui.o gobjnative/gui_w32.o gobjnative/gui_beval.o -lkernel32 
-luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lnetapi32 -lversion 
-lole32 -luuid
d:/users/john/documents/software/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: 
gobjnative/vim9cmds.o:vim9cmds.c:(.text+0x2628): undefined reference to 
`get_defer_var_idx'
d:/users/john/documents/software/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: 
gobjnative/vim9expr.o:vim9expr.c:(.text+0x5a9d): undefined reference to 
`get_defer_var_idx'

collect2.exe: error: ld returned 1 exit status
make: *** [Make_cyg_ming.mak:1137: gvim.exe] Error 1


This patch removed the function but not all of the calls.

Also, it looks like the contents of patch 9.0.0418 are the same as 9.0.0419.

Cheers
John

--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/a8955527-beea-9d92-f457-99d9c64b5dea%40internode.on.net.


Patch 9.0.0418

2022-09-08 Fir de Conversatie Bram Moolenaar


Patch 9.0.0418
Problem:Manually deleting temp test files.
Solution:   Use the 'D' flag of writefile() and mkdir().
Files:  src/testdir/test_cd.vim, src/testdir/test_changelist.vim,
src/testdir/test_channel.vim, src/testdir/test_checkpath.vim,
src/testdir/test_cmdline.vim, src/testdir/test_cmdwin.vim,
src/testdir/test_conceal.vim, src/testdir/test_cpoptions.vim,
src/testdir/test_cscope.vim, src/testdir/test_cursorline.vim


*** ../vim-9.0.0418/src/userfunc.c  2022-09-07 21:30:40.139379052 +0100
--- src/userfunc.c  2022-09-08 18:11:09.503285696 +0100
***
*** 5608,5613 
--- 5608,5614 
  ex_defer_inner(
char_u  *name,
char_u  **arg,
+   type_T  *type,
partial_T   *partial,
evalarg_T   *evalarg)
  {
***
*** 5640,5645 
--- 5641,5684 
  r = get_func_arguments(arg, evalarg, FALSE,
argvars + partial_argc, );
  argcount += partial_argc;
+ 
+ if (r == OK)
+ {
+   if (type != NULL)
+   {
+   // Check that the arguments are OK for the types of the funcref.
+   r = check_argument_types(type, argvars, argcount, NULL, name);
+   }
+   else if (builtin_function(name, -1))
+   {
+   int idx = find_internal_func(name);
+ 
+   if (idx < 0)
+   {
+   emsg_funcname(e_unknown_function_str, name);
+   r = FAIL;
+   }
+   else if (check_internal_func(idx, argcount) == -1)
+   r = FAIL;
+   }
+   else
+   {
+   ufunc_T *ufunc = find_func(name, FALSE);
+ 
+   // we tolerate an unknown function here, it might be defined later
+   if (ufunc != NULL)
+   {
+   int error = check_user_func_argcount(ufunc, argcount);
+ 
+   if (error != FCERR_UNKNOWN)
+   {
+   user_func_error(error, name, NULL);
+   r = FAIL;
+   }
+   }
+   }
+ }
+ 
  if (r == FAIL)
  {
while (--argcount >= 0)
***
*** 5839,5845 
  if (eap->cmdidx == CMD_defer)
  {
arg = startarg;
!   failed = ex_defer_inner(name, , partial, ) == FAIL;
  }
  else
  {
--- 5878,5884 
  if (eap->cmdidx == CMD_defer)
  {
arg = startarg;
!   failed = ex_defer_inner(name, , type, partial, ) == FAIL;
  }
  else
  {
*** ../vim-9.0.0418/src/vim9instr.c 2022-09-04 12:47:15.414692249 +0100
--- src/vim9instr.c 2022-09-08 19:39:51.440072875 +0100
***
*** 1329,1361 
  return OK;
  }
  
- 
  /*
!  * Generate an ISN_BCALL instruction.
!  * "method_call" is TRUE for "value->method()"
!  * Return FAIL if the number of arguments is wrong.
   */
  int
! generate_BCALL(cctx_T *cctx, int func_idx, int argcount, int method_call)
  {
- isn_T *isn;
  garray_T  *stack = >ctx_type_stack;
! int   argoff;
! type2_T   *typep;
! type2_T   *argtypes = NULL;
! type2_T   shuffled_argtypes[MAX_FUNC_ARGS];
! type2_T   *maptype = NULL;
! type_T*type;
! type_T*decl_type;
  
- RETURN_OK_IF_SKIP(cctx);
- argoff = check_internal_func(func_idx, argcount);
  if (argoff < 0)
return FAIL;
  
  if (method_call && argoff > 1)
  {
!   if ((isn = generate_instr(cctx, ISN_SHUFFLE)) == NULL)
return FAIL;
isn->isn_arg.shuffle.shfl_item = argcount;
isn->isn_arg.shuffle.shfl_up = argoff - 1;
--- 1329,1359 
  return OK;
  }
  
  /*
!  * Check "argount" arguments and their types on the type stack.
!  * Give an error and return FAIL if something is wrong.
!  * When "method_call" is NULL no code is generated.
   */
  int
! check_internal_func_args(
!   cctx_T  *cctx,
!   int func_idx,
!   int argcount,
!   int method_call,
!   type2_T **argtypes,
!   type2_T *shuffled_argtypes)
  {
  garray_T  *stack = >ctx_type_stack;
! int   argoff = check_internal_func(func_idx, argcount);
  
  if (argoff < 0)
return FAIL;
  
  if (method_call && argoff > 1)
  {
!   isn_T   *isn = generate_instr(cctx, ISN_SHUFFLE);
! 
!   if (isn  == NULL)
return FAIL;
isn->isn_arg.shuffle.shfl_item = argcount;
isn->isn_arg.shuffle.shfl_up = argoff - 1;
***
*** 1363,1379 
  
  if (argcount > 0)
  {
// Check the types of the arguments.
-   typep = ((type2_T *)stack->ga_data) + stack->ga_len - argcount;
if (method_call && argoff > 1)
{
int i;
  
for (i = 0; i < argcount; ++i)
shuffled_argtypes[i] = (i < argoff - 1)
!   ? typep[i + 1]
! : (i == argoff - 1) ? typep[0] : typep[i];
!   argtypes = 

Patch 9.0.0419

2022-09-08 Fir de Conversatie Bram Moolenaar


Patch 9.0.0419
Problem:The :defer command does not check the function argument count and
types.
Solution:   Check the function arguments when adding a deferred function.
Files:  src/userfunc.c, src/vim9instr.c, src/proto/vim9instr.pro,
src/vim9cmds.c, src/testdir/test_user_func.vim


*** ../vim-9.0.0418/src/userfunc.c  2022-09-07 21:30:40.139379052 +0100
--- src/userfunc.c  2022-09-08 18:11:09.503285696 +0100
***
*** 5608,5613 
--- 5608,5614 
  ex_defer_inner(
char_u  *name,
char_u  **arg,
+   type_T  *type,
partial_T   *partial,
evalarg_T   *evalarg)
  {
***
*** 5640,5645 
--- 5641,5684 
  r = get_func_arguments(arg, evalarg, FALSE,
argvars + partial_argc, );
  argcount += partial_argc;
+ 
+ if (r == OK)
+ {
+   if (type != NULL)
+   {
+   // Check that the arguments are OK for the types of the funcref.
+   r = check_argument_types(type, argvars, argcount, NULL, name);
+   }
+   else if (builtin_function(name, -1))
+   {
+   int idx = find_internal_func(name);
+ 
+   if (idx < 0)
+   {
+   emsg_funcname(e_unknown_function_str, name);
+   r = FAIL;
+   }
+   else if (check_internal_func(idx, argcount) == -1)
+   r = FAIL;
+   }
+   else
+   {
+   ufunc_T *ufunc = find_func(name, FALSE);
+ 
+   // we tolerate an unknown function here, it might be defined later
+   if (ufunc != NULL)
+   {
+   int error = check_user_func_argcount(ufunc, argcount);
+ 
+   if (error != FCERR_UNKNOWN)
+   {
+   user_func_error(error, name, NULL);
+   r = FAIL;
+   }
+   }
+   }
+ }
+ 
  if (r == FAIL)
  {
while (--argcount >= 0)
***
*** 5839,5845 
  if (eap->cmdidx == CMD_defer)
  {
arg = startarg;
!   failed = ex_defer_inner(name, , partial, ) == FAIL;
  }
  else
  {
--- 5878,5884 
  if (eap->cmdidx == CMD_defer)
  {
arg = startarg;
!   failed = ex_defer_inner(name, , type, partial, ) == FAIL;
  }
  else
  {
*** ../vim-9.0.0418/src/vim9instr.c 2022-09-04 12:47:15.414692249 +0100
--- src/vim9instr.c 2022-09-08 19:39:51.440072875 +0100
***
*** 1329,1361 
  return OK;
  }
  
- 
  /*
!  * Generate an ISN_BCALL instruction.
!  * "method_call" is TRUE for "value->method()"
!  * Return FAIL if the number of arguments is wrong.
   */
  int
! generate_BCALL(cctx_T *cctx, int func_idx, int argcount, int method_call)
  {
- isn_T *isn;
  garray_T  *stack = >ctx_type_stack;
! int   argoff;
! type2_T   *typep;
! type2_T   *argtypes = NULL;
! type2_T   shuffled_argtypes[MAX_FUNC_ARGS];
! type2_T   *maptype = NULL;
! type_T*type;
! type_T*decl_type;
  
- RETURN_OK_IF_SKIP(cctx);
- argoff = check_internal_func(func_idx, argcount);
  if (argoff < 0)
return FAIL;
  
  if (method_call && argoff > 1)
  {
!   if ((isn = generate_instr(cctx, ISN_SHUFFLE)) == NULL)
return FAIL;
isn->isn_arg.shuffle.shfl_item = argcount;
isn->isn_arg.shuffle.shfl_up = argoff - 1;
--- 1329,1359 
  return OK;
  }
  
  /*
!  * Check "argount" arguments and their types on the type stack.
!  * Give an error and return FAIL if something is wrong.
!  * When "method_call" is NULL no code is generated.
   */
  int
! check_internal_func_args(
!   cctx_T  *cctx,
!   int func_idx,
!   int argcount,
!   int method_call,
!   type2_T **argtypes,
!   type2_T *shuffled_argtypes)
  {
  garray_T  *stack = >ctx_type_stack;
! int   argoff = check_internal_func(func_idx, argcount);
  
  if (argoff < 0)
return FAIL;
  
  if (method_call && argoff > 1)
  {
!   isn_T   *isn = generate_instr(cctx, ISN_SHUFFLE);
! 
!   if (isn  == NULL)
return FAIL;
isn->isn_arg.shuffle.shfl_item = argcount;
isn->isn_arg.shuffle.shfl_up = argoff - 1;
***
*** 1363,1379 
  
  if (argcount > 0)
  {
// Check the types of the arguments.
-   typep = ((type2_T *)stack->ga_data) + stack->ga_len - argcount;
if (method_call && argoff > 1)
{
int i;
  
for (i = 0; i < argcount; ++i)
shuffled_argtypes[i] = (i < argoff - 1)
!   ? typep[i + 1]
! : (i == argoff - 1) ? typep[0] : typep[i];
!   argtypes = shuffled_argtypes;
}
else
{
--- 1361,1378 
  
  if (argcount > 0)
  {
+   type2_T *typep = ((type2_T *)stack->ga_data) + 

Re: removal of master/slave terminology from vim source code

2022-09-08 Fir de Conversatie Thomas Köhler
Hi,

On Thu, Sep 08, 2022 at 06:37:24AM -0700, Mike Fulton 
 wrote:
> Hi
> 
> I would make a small change to say it is the 'current terminology' but not
> the 'proper terminology'. I understand there is work involved in making
> these changes to be more inclusive and that it isn't 'free'.
> Does anyone else have thoughts on this change?

I have never seen the point in any of these "inclusive" terms.
Replacing fitting terms everybody can easily understand with
something else which then is named differently in all projects
doesn't make the project more inclusive, instead it makes all
projects more inaccessible as it requires much more information
on what terminology (that once was crystal clear) now is supposed
to be used and what given terminology in a given project is
supposed to mean. But that seems to be the new normal in today's
hypersensitive world.

> Thanks, Mike

Ciao,
Thomas

-- 
 Thomas Köhler   Email:   jean-...@picard.franken.de
 <>< WWW:  http://gott-gehabt.de
 IRC: tkoehler   Freenode: thkoehler
 PGP public key available from Homepage!

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/Yxo239/4MnIM4ofG%40picard.franken.de.


Re: removal of master/slave terminology from vim source code

2022-09-08 Fir de Conversatie Bram Moolenaar


> I would make a small change to say it is the 'current terminology' but not
> the 'proper terminology'. I understand there is work involved in making
> these changes to be more inclusive and that it isn't 'free'.
> Does anyone else have thoughts on this change?

I do not see any relation between the terms master and slave and "more
inclusive".  This is using a catchprhase in the wrong context.

-- 
How To Keep A Healthy Level Of Insanity:
18. When leaving the zoo, start running towards the parking lot,
yelling "run for your lives, they're loose!!"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220908160614.01C7A1C0B04%40moolenaar.net.


Patch 9.0.0417

2022-09-08 Fir de Conversatie Bram Moolenaar


Patch 9.0.0417
Problem:Jsonnet files are not recognized.
Solution:   Add a pattern for Jsonnet files. (Cezary Drożak, closes #11073,
closes #11081)
Files:  runtime/filetype.vim src/testdir/test_filetype.vim


*** ../vim-9.0.0416/runtime/filetype.vim2022-09-07 14:13:27.570136882 
+0100
--- runtime/filetype.vim2022-09-08 14:37:17.019380320 +0100
***
*** 978,983 
--- 978,986 
  " JSONC
  au BufNewFile,BufRead *.jsonc setf jsonc
  
+ " Jsonnet
+ au BufNewFile,BufRead *.jsonnet,*.libjsonnet  setf jsonnet
+ 
  " Julia
  au BufNewFile,BufRead *.jlsetf julia
  
*** ../vim-9.0.0416/src/testdir/test_filetype.vim   2022-09-07 
14:13:27.574136878 +0100
--- src/testdir/test_filetype.vim   2022-09-08 14:37:17.019380320 +0100
***
*** 285,290 
--- 285,291 
  \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 
'file.webmanifest', 'Pipfile.lock', 'file.ipynb', '.babelrc', '.eslintrc', 
'.prettierrc', '.firebaserc', 'file.slnf'],
  \ 'json5': ['file.json5'],
  \ 'jsonc': ['file.jsonc'],
+ \ 'jsonnet': ['file.jsonnet', 'file.libjsonnet'],
  \ 'jsp': ['file.jsp'],
  \ 'julia': ['file.jl'],
  \ 'kconfig': ['Kconfig', 'Kconfig.debug', 'Kconfig.file'],
*** ../vim-9.0.0416/src/version.c   2022-09-08 13:42:50.296283575 +0100
--- src/version.c   2022-09-08 14:40:57.066919217 +0100
***
*** 705,706 
--- 705,708 
  {   /* Add new patch number below this line */
+ /**/
+ 417,
  /**/

-- 
How To Keep A Healthy Level Of Insanity:
17. When the money comes out the ATM, scream "I won!, I won! 3rd
time this week!"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220908134226.E3DA91C0B4B%40moolenaar.net.


Re: removal of master/slave terminology from vim source code

2022-09-08 Fir de Conversatie Mike Fulton
Hi

I would make a small change to say it is the 'current terminology' but not
the 'proper terminology'. I understand there is work involved in making
these changes to be more inclusive and that it isn't 'free'.
Does anyone else have thoughts on this change?

Thanks, Mike

On Wed, Sep 7, 2022 at 11:18 PM Dominique Pellé 
wrote:

> Mike Fulton  wrote:
>
> > Hi,
> >
> > I would like to propose removing the master/slave terminology from
> > the vim source code and replacng it with more inclusive, and hopefully
> > more accurate, terminology.
> > I am open to suggestions for the right terms to use.
> > The particular area that I see most occurrences in is the 'pty' code.
> > How about using controller/controlled instead of master/slave (or perhaps
> > controlling/controlled?) ?
> > I would be happy to develop and test the patch. I believe this would
> > strictly be changes to variable names but I would need to do a more
> > thorough check to see if there are any externals.
>
> I'm no expert on pty, but master/slave seems to be the
> proper terminology. I e.g. see it here:
>
> https://man7.org/linux/man-pages/man7/pty.7.html
> https://en.wikipedia.org/wiki/Pseudoterminal
>
> I understand that there is a trend to replace for example
> the master branch by the main branch in git repos as
> some people feel offended by the terminology. But frankly,
> there is no reason to be offended by a word when its
> meaning clearly depends on the context. There was
> clearly not ill intention in the terminology. And renaming
> causes problems to users and to existing scripts. Now
> when I'm in a git repo, I no longer know whether I need
> to checkout from master, or main, or trunk, or dev, or
> root, or unicornbranch (...) as it depends on each project.
>
> Regards
> Dominique
>
> --
> --
> 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 a topic in the
> Google Groups "vim_dev" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/vim_dev/XG5whXSmJWk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> vim_dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vim_dev/CAON-T_jJ40R1f2ge7Dm0FCKyNFGDx9_2wa7zYeFBcZUOm1BdBw%40mail.gmail.com
> .
>

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAOmchhEkWQQNHhwmvcoX7447GBb-%2B81trSFork5mmTdarUjrfw%40mail.gmail.com.


Patch 9.0.0416

2022-09-08 Fir de Conversatie Bram Moolenaar


Patch 9.0.0416
Problem:ml_get error when appending lines in popup window.
Solution:   Only update w_topline when w_buffer matches curbuf.
(closes #11074)
Files:  src/evalbuffer.c, src/testdir/test_popupwin.vim,
src/testdir/dumps/Test_term_popup_bufline.dump


*** ../vim-9.0.0415/src/evalbuffer.c2022-08-25 15:11:11.404084538 +0100
--- src/evalbuffer.c2022-09-08 13:36:14.896892029 +0100
***
*** 254,260 
&& wp->w_cursor.lnum > append_lnum)
wp->w_cursor.lnum += added;
check_cursor_col();
!   update_topline();
  }
  
  done:
--- 254,264 
&& wp->w_cursor.lnum > append_lnum)
wp->w_cursor.lnum += added;
check_cursor_col();
! 
!   // Only update the window view if w_buffer matches curbuf, otherwise
!   // the computations will be wrong.
!   if (curwin->w_buffer == curbuf)
!   update_topline();
  }
  
  done:
*** ../vim-9.0.0415/src/testdir/test_popupwin.vim   2022-09-02 
21:55:45.507049444 +0100
--- src/testdir/test_popupwin.vim   2022-09-08 13:35:04.801003354 +0100
***
*** 4174,4178 
--- 4174,4201 
  call popup_close(id)
  endfunc
  
+ func Test_term_popup_bufline()
+   " very specific situation where a non-existing buffer line is used, leading
+   " to an ml_get error
+   CheckScreendump
+ 
+   let lines =<< trim END
+   vim9script
+= 5
+   term_start('seq 1 5', {term_finish: 'open'})
+   timer_start(50, (_) => {
+ set cpoptions
+ var buf = popup_create([], {})->winbufnr()
+ appendbufline(buf, 0, range(5))
+   })
+   END
+   call writefile(lines, 'XtestTermPopup', 'D')
+   let buf = RunVimInTerminal('-S XtestTermPopup', #{rows: 15})
+   call VerifyScreenDump(buf, 'Test_term_popup_bufline', {})
+ 
+   " clean up
+   call StopVimInTerminal(buf)
+ endfunc
+ 
  
  " vim: shiftwidth=2 sts=2
*** ../vim-9.0.0415/src/testdir/dumps/Test_term_popup_bufline.dump  
2022-09-08 13:41:34.948397540 +0100
--- src/testdir/dumps/Test_term_popup_bufline.dump  2022-09-08 
13:36:27.284872494 +0100
***
*** 0 
--- 1,15 
+ 

Patch 9.0.0414

2022-09-08 Fir de Conversatie Bram Moolenaar


Patch 9.0.0414 (after 9.0.0407)
Problem:matchstr() still does not match column offset when done after a
text search.
Solution:   Only use the line number for a multi-line search.  Fix the test.
(closes #10938)
Files:  src/regexp_bt.c, src/regexp_nfa.c,
src/testdir/test_regexp_latin.vim


*** ../vim-9.0.0413/src/regexp_bt.c 2022-09-07 18:21:21.200339788 +0100
--- src/regexp_bt.c 2022-09-08 12:11:02.110577579 +0100
***
*** 3441,3451 
  case RE_VCOL:
{
win_T   *wp = rex.reg_win == NULL ? curwin : rex.reg_win;
!   linenr_Tlnum = rex.reg_firstlnum + rex.lnum;
!   long_u  vcol = 0;
  
!   if (lnum >= 0 && lnum <= wp->w_buffer->b_ml.ml_line_count)
!   vcol = (long_u)win_linetabsize(wp, lnum, rex.line,
  (colnr_T)(rex.input - rex.line));
if (!re_num_cmp(vcol + 1, scan))
status = RA_NOMATCH;
--- 3441,3453 
  case RE_VCOL:
{
win_T   *wp = rex.reg_win == NULL ? curwin : rex.reg_win;
!   linenr_Tlnum = REG_MULTI ? rex.reg_firstlnum + rex.lnum : 1;
!   long_u  vcol;
  
!   if (REG_MULTI && (lnum <= 0
!  || lnum > wp->w_buffer->b_ml.ml_line_count))
!   lnum = 1;
!   vcol = (long_u)win_linetabsize(wp, lnum, rex.line,
  (colnr_T)(rex.input - rex.line));
if (!re_num_cmp(vcol + 1, scan))
status = RA_NOMATCH;
*** ../vim-9.0.0413/src/regexp_nfa.c2022-09-07 18:21:21.200339788 +0100
--- src/regexp_nfa.c2022-09-08 12:06:46.790561260 +0100
***
*** 6775,6786 
}
if (!result)
{
!   linenr_Tlnum = rex.reg_firstlnum + rex.lnum;
!   long_u  vcol = 0;
  
!   if (lnum >= 0
!  && lnum <= wp->w_buffer->b_ml.ml_line_count)
!   vcol = (long_u)win_linetabsize(wp, lnum,
rex.line, col);
result = nfa_re_num_cmp(t->state->val, op, vcol + 1);
}
--- 6775,6788 
}
if (!result)
{
!   linenr_Tlnum = REG_MULTI
!   ? rex.reg_firstlnum + rex.lnum : 1;
!   long_u  vcol;
  
!   if (REG_MULTI && (lnum <= 0
!  || lnum > wp->w_buffer->b_ml.ml_line_count))
!   lnum = 1;
!   vcol = (long_u)win_linetabsize(wp, lnum,
rex.line, col);
result = nfa_re_num_cmp(t->state->val, op, vcol + 1);
}
*** ../vim-9.0.0413/src/testdir/test_regexp_latin.vim   2022-09-07 
18:21:21.200339788 +0100
--- src/testdir/test_regexp_latin.vim   2022-09-08 11:56:43.290518493 +0100
***
*** 1145,1151 
--- 1145,1157 
  enddef
  
  def Test_compare_column_matchstr()
+   # do some search in text to set the line number, it should be ignored in
+   # matchstr().
enew
+   setline(1, ['one', 'two', 'three'])
+   :3 
+   :/ee
+   bwipe!
set re=1
call assert_equal('aaa', matchstr('', '.*\%<5v'))
set re=2
*** ../vim-9.0.0413/src/version.c   2022-09-08 10:55:34.233826402 +0100
--- src/version.c   2022-09-08 12:13:41.310501442 +0100
***
*** 705,706 
--- 705,708 
  {   /* Add new patch number below this line */
+ /**/
+ 414,
  /**/

-- 
How To Keep A Healthy Level Of Insanity:
12. Sing along at the opera.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220908112915.37B901C0B04%40moolenaar.net.


Patch 9.0.0415

2022-09-08 Fir de Conversatie Bram Moolenaar


Patch 9.0.0415
Problem:On MS-Windows some tests are flaky.
Solution:   Add sleeps, disable swapfile, mark test as flaky. (Ken Takata,
closes #11082)
Files:  src/testdir/test_autocmd.vim, src/testdir/test_buffer.vim,
src/testdir/test_bufline.vim, src/testdir/test_profile.vim,
src/testdir/test_shell.vim, src/testdir/test_undo.vim,
src/testdir/test_viminfo.vim


*** ../vim-9.0.0414/src/testdir/test_autocmd.vim2022-09-07 
21:30:40.143379043 +0100
--- src/testdir/test_autocmd.vim2022-09-08 12:25:29.341756968 +0100
***
*** 763,768 
--- 763,769 
  
call writefile(content, 'Xvimrc', 'D')
call system(GetVimCommand('Xvimrc') .. ' --not-a-term --noplugins -S 
Session.vim -c cq')
+   sleep 50m
let errors = join(readfile('Xerrors'))
call assert_match('E814:', errors)
  
*** ../vim-9.0.0414/src/testdir/test_buffer.vim 2022-09-05 21:40:40.438306254 
+0100
--- src/testdir/test_buffer.vim 2022-09-08 12:25:29.341756968 +0100
***
*** 375,380 
--- 375,381 
  func Test_buffer_scheme()
CheckMSWindows
  
+   set noswapfile
set noshellslash
%bwipe!
let bufnames = [
***
*** 397,402 
--- 398,404 
endfor
  
set shellslash&
+   set swapfile&
  endfunc
  
  " this was using a NULL pointer after failing to use the pattern
*** ../vim-9.0.0414/src/testdir/test_bufline.vim2022-09-05 
21:40:40.438306254 +0100
--- src/testdir/test_bufline.vim2022-09-08 12:25:29.341756968 +0100
***
*** 83,88 
--- 83,89 
endif
call writefile(['call setline(1, "Hello")', 'silent w Xtest', 'q!'], 
'Xscript', 'D')
call system(cmd)
+   sleep 50m
call assert_equal(['Hello'], readfile('Xtest'))
  
call delete('Xtest')
*** ../vim-9.0.0414/src/testdir/test_profile.vim2022-04-08 
13:15:22.0 +0100
--- src/testdir/test_profile.vim2022-09-08 12:25:29.341756968 +0100
***
*** 53,58 
--- 53,59 
  \ . ' -c "qall!"')
call assert_equal(0, v:shell_error)
  
+   sleep 50m
let lines = readfile('Xprofile_func.log')
  
" - Foo1() is called 3 times but should be reported as called twice
*** ../vim-9.0.0414/src/testdir/test_shell.vim  2021-09-01 13:27:48.0 
+0100
--- src/testdir/test_shell.vim  2022-09-08 12:25:29.341756968 +0100
***
*** 5,10 
--- 5,15 
  source shared.vim
  
  func Test_shell_options()
+   if has('win32')
+ " FIXME: This test is flaky on MS-Windows.
+ let g:test_is_flaky = 1
+   endif
+ 
" The expected value of 'shellcmdflag', 'shellpipe', 'shellquote',
" 'shellredir', 'shellxescape', 'shellxquote' for the supported shells.
let shells = []
*** ../vim-9.0.0414/src/testdir/test_undo.vim   2022-08-15 17:28:23.660240894 
+0100
--- src/testdir/test_undo.vim   2022-09-08 12:25:29.341756968 +0100
***
*** 335,340 
--- 335,345 
  endfunc
  
  func Test_undofile_earlier()
+   if has('win32')
+ " FIXME: This test is flaky on MS-Windows.
+ let g:test_is_flaky = 1
+   endif
+ 
" Issue #1254
" create undofile with timestamps older than Vim startup time.
let t0 = localtime() - 43200
*** ../vim-9.0.0414/src/testdir/test_viminfo.vim2022-08-29 
22:31:15.923685244 +0100
--- src/testdir/test_viminfo.vim2022-09-08 12:25:29.341756968 +0100
***
*** 722,727 
--- 722,728 
  endfunc
  
  func Test_viminfo_oldfiles()
+   set noswapfile
let v:oldfiles = []
let lines = [
\ '# comment line',
***
*** 765,770 
--- 766,772 
call assert_equal("/tmp/another.txt", expand("%"))
bwipe
delmark E
+   set swapfile&
  endfunc
  
  " Test for storing and restoring buffer list in 'viminfo'
*** ../vim-9.0.0414/src/version.c   2022-09-08 12:17:02.006342437 +0100
--- src/version.c   2022-09-08 12:26:52.781645725 +0100
***
*** 705,706 
--- 705,708 
  {   /* Add new patch number below this line */
+ /**/
+ 415,
  /**/

-- 
How To Keep A Healthy Level Of Insanity:
11. Specify that your drive-through order is "to go".

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 

Patch 9.0.0413

2022-09-08 Fir de Conversatie Bram Moolenaar


Patch 9.0.0413
Problem:ASAN reports a memory leak.
Solution:   Free the string received from the server. (Ken Takata,
closes #11080)
Files:  src/clientserver.c


*** ../vim-9.0.0412/src/clientserver.c  2022-03-22 20:38:51.0 +
--- src/clientserver.c  2022-09-08 10:53:49.638937733 +0100
***
*** 423,431 
if (argtype == ARGTYPE_EDIT_WAIT)
{
int numFiles = *argc - i - 1;
-   int j;
char_u  *done = alloc(numFiles);
-   char_u  *p;
  # ifdef FEAT_GUI_MSWIN
NOTIFYICONDATA ni;
int count = 0;
--- 423,429 
***
*** 450,455 
--- 448,455 
vim_memset(done, 0, numFiles);
while (memchr(done, 0, numFiles) != NULL)
{
+   char_u  *p;
+   int j;
  # ifdef MSWIN
p = serverGetReply(srv, NULL, TRUE, TRUE, 0);
if (p == NULL)
***
*** 459,464 
--- 459,465 
break;
  # endif
j = atoi((char *)p);
+   vim_free(p);
if (j >= 0 && j < numFiles)
{
  # ifdef FEAT_GUI_MSWIN
*** ../vim-9.0.0412/src/version.c   2022-09-07 21:46:48.733219019 +0100
--- src/version.c   2022-09-08 10:55:06.306105719 +0100
***
*** 705,706 
--- 705,708 
  {   /* Add new patch number below this line */
+ /**/
+ 413,
  /**/

-- 
How To Keep A Healthy Level Of Insanity:
5. Put decaf in the coffee maker for 3 weeks. Once everyone has gotten
   over their caffeine addictions, switch to espresso.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220908095815.535E41C0B4B%40moolenaar.net.


Re: removal of master/slave terminology from vim source code

2022-09-08 Fir de Conversatie Dominique Pellé
Mike Fulton  wrote:

> Hi,
>
> I would like to propose removing the master/slave terminology from
> the vim source code and replacng it with more inclusive, and hopefully
> more accurate, terminology.
> I am open to suggestions for the right terms to use.
> The particular area that I see most occurrences in is the 'pty' code.
> How about using controller/controlled instead of master/slave (or perhaps
> controlling/controlled?) ?
> I would be happy to develop and test the patch. I believe this would
> strictly be changes to variable names but I would need to do a more
> thorough check to see if there are any externals.

I'm no expert on pty, but master/slave seems to be the
proper terminology. I e.g. see it here:

https://man7.org/linux/man-pages/man7/pty.7.html
https://en.wikipedia.org/wiki/Pseudoterminal

I understand that there is a trend to replace for example
the master branch by the main branch in git repos as
some people feel offended by the terminology. But frankly,
there is no reason to be offended by a word when its
meaning clearly depends on the context. There was
clearly not ill intention in the terminology. And renaming
causes problems to users and to existing scripts. Now
when I'm in a git repo, I no longer know whether I need
to checkout from master, or main, or trunk, or dev, or
root, or unicornbranch (...) as it depends on each project.

Regards
Dominique

-- 
-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAON-T_jJ40R1f2ge7Dm0FCKyNFGDx9_2wa7zYeFBcZUOm1BdBw%40mail.gmail.com.