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.204 < prev    next >
Encoding:
Internet Message Format  |  2002-02-07  |  2.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.204
  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.204
  11. Problem:    ":unlet" doesn't work for variables with curly braces. (Thomas
  12.         Scott Urban)
  13. Solution:   Handle variable names with curly braces properly. (Vince Negri)
  14. Files:        src/eval.c
  15.  
  16.  
  17. *** ../vim60.203/src/eval.c    Wed Feb  6 20:40:51 2002
  18. --- src/eval.c    Fri Feb  8 19:06:00 2002
  19. ***************
  20. *** 1031,1051 ****
  21.       char_u    *arg = eap->arg;
  22.       char_u    *name_end;
  23.       char_u    cc;
  24.   
  25.       do
  26.       {
  27. -     name_end = skiptowhite(arg);
  28. -     cc = *name_end;
  29. -     *name_end = NUL;
  30.   
  31. !     if (do_unlet(arg) == FAIL && !eap->forceit)
  32.       {
  33. !         *name_end = cc;
  34. !         EMSG2(_("E108: No such variable: \"%s\""), arg);
  35. !         break;
  36.       }
  37.   
  38. !     *name_end = cc;
  39.       arg = skipwhite(name_end);
  40.       } while (*arg != NUL);
  41.   }
  42. --- 1031,1080 ----
  43.       char_u    *arg = eap->arg;
  44.       char_u    *name_end;
  45.       char_u    cc;
  46. +     char_u    *expr_start;
  47. +     char_u    *expr_end;
  48.   
  49.       do
  50.       {
  51.   
  52. !     /* Find the end of the name. */
  53. !     name_end = find_name_end(arg, &expr_start, &expr_end);
  54. ! #ifdef FEAT_MAGIC_BRACES
  55. !     if (expr_start != NULL)
  56.       {
  57. !         char_u  *temp_string;
  58. !         temp_string = make_expanded_name(arg, expr_start,
  59. !                              expr_end, name_end);
  60. !         if (temp_string == NULL)
  61. !         EMSG2(_(e_invarg2), arg);
  62. !         else
  63. !         {
  64. !         if (do_unlet(temp_string) == FAIL && !eap->forceit)
  65. !         {
  66. !             EMSG2(_("E108: No such variable: \"%s\""), temp_string);
  67. !             vim_free(temp_string);
  68. !             break;
  69. !         }
  70. !         vim_free(temp_string);
  71. !         }
  72.       }
  73. +     else
  74. + #endif
  75. +     {
  76. +         cc = *name_end;
  77. +         *name_end = NUL;
  78.   
  79. !         if (do_unlet(arg) == FAIL && !eap->forceit)
  80. !         {
  81. !         *name_end = cc;
  82. !         EMSG2(_("E108: No such variable: \"%s\""), arg);
  83. !         break;
  84. !         }
  85. !         *name_end = cc;
  86. !     }
  87.       arg = skipwhite(name_end);
  88.       } while (*arg != NUL);
  89.   }
  90. *** ../vim60.203/src/version.c    Fri Feb  8 10:30:44 2002
  91. --- src/version.c    Fri Feb  8 19:08:29 2002
  92. ***************
  93. *** 608,609 ****
  94. --- 608,611 ----
  95.   {   /* Add new patch number below this line */
  96. + /**/
  97. +     204,
  98.   /**/
  99.  
  100. -- 
  101.        "To whoever finds this note -
  102.        I have been imprisoned by my father who wishes me to marry
  103.        against my will.  Please please please please come and rescue me.
  104.        I am in the tall tower of Swamp Castle."
  105.    SIR LAUNCELOT's eyes light up with holy inspiration.
  106.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  107.  
  108.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  109. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  110.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  111.