home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.100 < prev    next >
Encoding:
Internet Message Format  |  2001-12-14  |  2.6 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.100
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.100
  11. Problem:    ":badd +0 test%file" causes a crash.
  12. Solution:   Take into account that the "+0" is NUL terminated when allocating
  13.         room for replacing the "%".
  14. Files:        src/ex_docmd.c
  15.  
  16.  
  17. *** ../vim60.99/src/ex_docmd.c    Fri Nov  2 16:29:44 2001
  18. --- src/ex_docmd.c    Sat Dec 15 21:34:01 2001
  19. ***************
  20. *** 3330,3336 ****
  21.   /*
  22.    * Replace part of the command line, keeping eap->cmd, eap->arg and
  23.    * eap->nextcmd correct.
  24. !  * "src" points to the part that is to be replaced, of lenght "srclen".
  25.    * "repl" is the replacement string.
  26.    * Returns a pointer to the character after the replaced string.
  27.    * Returns NULL for failure.
  28. --- 3330,3336 ----
  29.   /*
  30.    * Replace part of the command line, keeping eap->cmd, eap->arg and
  31.    * eap->nextcmd correct.
  32. ! * "src" points to the part that is to be replaced, of length "srclen".
  33.    * "repl" is the replacement string.
  34.    * Returns a pointer to the character after the replaced string.
  35.    * Returns NULL for failure.
  36. ***************
  37. *** 3350,3358 ****
  38.       /*
  39.        * The new command line is build in new_cmdline[].
  40.        * First allocate it.
  41.        */
  42.       len = (int)STRLEN(repl);
  43. !     i = (int)STRLEN(*cmdlinep) + len + 3;
  44.       if (eap->nextcmd)
  45.       i += (int)STRLEN(eap->nextcmd);/* add space for next command */
  46.       if ((new_cmdline = alloc((unsigned)i)) == NULL)
  47. --- 3350,3359 ----
  48.       /*
  49.        * The new command line is build in new_cmdline[].
  50.        * First allocate it.
  51. +      * Careful: a "+cmd" argument may have been NUL terminated.
  52.        */
  53.       len = (int)STRLEN(repl);
  54. !     i = (int)(src - *cmdlinep) + (int)STRLEN(src + srclen) + len + 3;
  55.       if (eap->nextcmd)
  56.       i += (int)STRLEN(eap->nextcmd);/* add space for next command */
  57.       if ((new_cmdline = alloc((unsigned)i)) == NULL)
  58. *** ../vim60.99/src/version.c    Sat Dec 15 21:39:19 2001
  59. --- src/version.c    Sat Dec 15 21:05:08 2001
  60. ***************
  61. *** 608,609 ****
  62. --- 608,611 ----
  63.   {   /* Add new patch number below this line */
  64. + /**/
  65. +     100,
  66.   /**/
  67.  
  68. -- 
  69. hundred-and-one symptoms of being an internet addict:
  70. 116. You are living with your boyfriend who networks your respective
  71.      computers so you can sit in separate rooms and email each other
  72.  
  73.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  74. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  75.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  76.