Patch 8.2.5148
Problem:    Invalid memory access when using an expression on the command line.
Solution:   Make sure the position does not go negative.
Files:      src/ex_getln.c, src/testdir/test_cmdline.vim


*** ../vim-8.2.5147/src/ex_getln.c      2022-06-16 11:14:51.953291054 +0100
--- src/ex_getln.c      2022-06-22 13:45:19.915255481 +0100
***************
*** 1206,1211 ****
--- 1206,1212 ----
  {
      int               i;
      int               c;
+     int               save_new_cmdpos = new_cmdpos;
  
  #ifdef USE_ON_FLY_SCROLL
      dont_scroll = TRUE;       // disallow scrolling here
***************
*** 1224,1231 ****
  #ifdef FEAT_EVAL
      /*
       * Insert the result of an expression.
-      * Need to save the current command line, to be able to enter
-      * a new one...
       */
      new_cmdpos = -1;
      if (c == '=')
--- 1225,1230 ----
***************
*** 1266,1271 ****
--- 1265,1272 ----
        }
  #endif
      }
+     new_cmdpos = save_new_cmdpos;
+ 
      // remove the double quote
      redrawcmd();
  
*** ../vim-8.2.5147/src/testdir/test_cmdline.vim        2022-06-06 
15:38:10.867573392 +0100
--- src/testdir/test_cmdline.vim        2022-06-22 13:41:21.352562312 +0100
***************
*** 1987,1992 ****
--- 1987,1997 ----
    call assert_equal("\"e \<C-\>\<C-Y>", @:)
  endfunc
  
+ " This was making the insert position negative
+ func Test_cmdline_expr_register()
+   exe "sil! norm! ?\<C-\>e0\<C-R>0\<Esc>?\<C-\>e0\<CR>"
+ endfunc
+ 
  " Test for 'imcmdline' and 'imsearch'
  " This test doesn't actually test the input method functionality.
  func Test_cmdline_inputmethod()
*** ../vim-8.2.5147/src/version.c       2022-06-21 22:35:37.067256396 +0100
--- src/version.c       2022-06-22 13:43:27.343930727 +0100
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     5148,
  /**/

-- 
For large projects, Team Leaders use sophisticated project management software
to keep track of who's doing what.  The software collects the lies and guesses
of the project team and organizes them in to instantly outdated charts that
are too boring to look at closely.  This is called "planning".
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [email protected] -- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220622125219.9153B1C0550%40moolenaar.net.

Raspunde prin e-mail lui