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 / old / 5.4.3 < prev    next >
Encoding:
Internet Message Format  |  1999-07-28  |  3.5 KB

  1. To: Wichert Akkerman <wakkerma@wi.leidenuniv.nl>
  2. Cc: VIM Development List <vim-dev@vim.org>
  3. Subject: patch 5.4.3 (was: Bug#42005: SEGV when using Python hooks)
  4. In-Reply-To: <19990728141726.A19213@cs.leidenuniv.nl>
  5. Fcc: outbox
  6. From: Bram Moolenaar <Bram@moolenaar.net>
  7. ------------
  8.  
  9. Wichert Akkerman wrote:
  10.  
  11. > I got this bugreport yesterday through the Debian Bugtracking system.
  12. > Since I don't use (or know) python myself I can't help him..
  13. > Can anyone reproduce this?
  14.  
  15. Yes.  Easy to spot the problem with "ddd".
  16.  
  17. [...]
  18. >   Executing the following two commands when an unnamed file is loaded into
  19. > buffer 0 causes vim to segv.  If I understand the documentation correctly,
  20. > it should print out the repr of the 0th buffer.  Accessing members of
  21. > vim.buffers[0] works correctly and loading a file, then printing
  22. > vim.buffers[0] works correctly.
  23. > :python import vim
  24. > :python print vim.buffers[0]
  25.  
  26.  
  27. Patch 5.4.3
  28. Problem:    Python: Trying to use the name of an unnamed buffer caused a 
  29.             crash. (Daniel Burrows)
  30. Solution:   Check for b_fname being a NULL pointer.
  31. Files:      src/if_python.c
  32.  
  33.  
  34. *** ../vim-5.4/src/if_python.c    Sun Jul 25 22:02:15 1999
  35. --- src/if_python.c    Wed Jul 28 15:55:29 1999
  36. ***************
  37. *** 951,957 ****
  38.       else
  39.       {
  40.       char *name = (char *)this->buf->b_fname;
  41. !     int len = strlen(name);
  42.   
  43.       if (len > 35)
  44.           name = name + (35 - len);
  45. --- 951,961 ----
  46.       else
  47.       {
  48.       char *name = (char *)this->buf->b_fname;
  49. !     int len;
  50. !     if (name == NULL)
  51. !         name = "";
  52. !     len = strlen(name);
  53.   
  54.       if (len > 35)
  55.           name = name + (35 - len);
  56. ***************
  57. *** 1162,1168 ****
  58.       else
  59.       {
  60.       char *name = (char *)this->buf->buf->b_fname;
  61. !     int len = strlen(name);
  62.   
  63.       if (len > 45)
  64.           name = name + (45 - len);
  65. --- 1166,1176 ----
  66.       else
  67.       {
  68.       char *name = (char *)this->buf->buf->b_fname;
  69. !     int len;
  70. !     if (name == NULL)
  71. !         name = "";
  72. !     len = strlen(name);
  73.   
  74.       if (len > 45)
  75.           name = name + (45 - len);
  76. *** /tmp/version.h    Wed Jul 28 16:00:56 1999
  77. --- src/version.h    Wed Jul 28 16:01:19 1999
  78. ***************
  79. *** 19,26 ****
  80.   #define VIM_VERSION_MINOR_STR        "4"
  81.   #define VIM_VERSION_BUILD         57
  82.   #define VIM_VERSION_BUILD_STR        "57"
  83. ! #define VIM_VERSION_PATCHLEVEL         2
  84. ! #define VIM_VERSION_PATCHLEVEL_STR    "2"
  85.   
  86.   /*
  87.    * VIM_VERSION_NODOT is used for the runtime directory name.
  88. --- 19,26 ----
  89.   #define VIM_VERSION_MINOR_STR        "4"
  90.   #define VIM_VERSION_BUILD         57
  91.   #define VIM_VERSION_BUILD_STR        "57"
  92. ! #define VIM_VERSION_PATCHLEVEL         3
  93. ! #define VIM_VERSION_PATCHLEVEL_STR    "3"
  94.   
  95.   /*
  96.    * VIM_VERSION_NODOT is used for the runtime directory name.
  97. ***************
  98. *** 30,35 ****
  99.    */
  100.   #define VIM_VERSION_NODOT    "vim54"
  101.   #define VIM_VERSION_SHORT    "5.4"
  102. ! #define VIM_VERSION_MEDIUM    "5.4.2"
  103. ! #define VIM_VERSION_LONG    "VIM - Vi IMproved 5.4.2 (1999 Jul 27)"
  104. ! #define VIM_VERSION_LONG_DATE    "VIM - Vi IMproved 5.4.2 (1999 Jul 27, compiled "
  105. --- 30,35 ----
  106.    */
  107.   #define VIM_VERSION_NODOT    "vim54"
  108.   #define VIM_VERSION_SHORT    "5.4"
  109. ! #define VIM_VERSION_MEDIUM    "5.4.3"
  110. ! #define VIM_VERSION_LONG    "VIM - Vi IMproved 5.4.3 (1999 Jul 28)"
  111. ! #define VIM_VERSION_LONG_DATE    "VIM - Vi IMproved 5.4.3 (1999 Jul 28, compiled "
  112.  
  113. --
  114. CONCORDE: Message for you, sir.
  115.    He falls forward revealing the arrow with the note.
  116.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  117.  
  118. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  119.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  120.