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 / 7.4 / 7.4.602 < prev    next >
Encoding:
Internet Message Format  |  2015-01-27  |  3.0 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.602
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.4.602
  11. Problem:    ":set" does not accept hex numbers as documented.
  12. Solution:   Use vim_str2nr(). (ZyX)
  13. Files:        src/option.c, runtime/doc/options.txt
  14.  
  15.  
  16. *** ../vim-7.4.601/src/option.c    2014-11-30 13:34:16.885626772 +0100
  17. --- src/option.c    2015-01-27 15:51:01.455344467 +0100
  18. ***************
  19. *** 4540,4560 ****
  20.                   goto skip;
  21.                   }
  22.               }
  23. -                 /* allow negative numbers (for 'undolevels') */
  24.               else if (*arg == '-' || VIM_ISDIGIT(*arg))
  25.               {
  26. !                 i = 0;
  27. !                 if (*arg == '-')
  28. !                 i = 1;
  29. ! #ifdef HAVE_STRTOL
  30. !                 value = strtol((char *)arg, NULL, 0);
  31. !                 if (arg[i] == '0' && TOLOWER_ASC(arg[i + 1]) == 'x')
  32. !                 i += 2;
  33. ! #else
  34. !                 value = atol((char *)arg);
  35. ! #endif
  36. !                 while (VIM_ISDIGIT(arg[i]))
  37. !                 ++i;
  38.                   if (arg[i] != NUL && !vim_iswhite(arg[i]))
  39.                   {
  40.                   errmsg = e_invarg;
  41. --- 4540,4550 ----
  42.                   goto skip;
  43.                   }
  44.               }
  45.               else if (*arg == '-' || VIM_ISDIGIT(*arg))
  46.               {
  47. !                 /* Allow negative (for 'undolevels'), octal and
  48. !                  * hex numbers. */
  49. !                 vim_str2nr(arg, NULL, &i, TRUE, TRUE, &value, NULL);
  50.                   if (arg[i] != NUL && !vim_iswhite(arg[i]))
  51.                   {
  52.                   errmsg = e_invarg;
  53. *** ../vim-7.4.601/runtime/doc/options.txt    2014-11-05 17:44:47.676471691 +0100
  54. --- runtime/doc/options.txt    2015-01-27 15:47:53.873380762 +0100
  55. ***************
  56. *** 59,67 ****
  57.   :se[t] {option}:{value}
  58.               Set string or number option to {value}.
  59.               For numeric options the value can be given in decimal,
  60. !             hex (preceded with 0x) or octal (preceded with '0')
  61. !             (hex and octal are only available for machines which
  62. !             have the strtol() function).
  63.               The old value can be inserted by typing 'wildchar' (by
  64.               default this is a <Tab> or CTRL-E if 'compatible' is
  65.               set).  See |cmdline-completion|.
  66. --- 59,65 ----
  67.   :se[t] {option}:{value}
  68.               Set string or number option to {value}.
  69.               For numeric options the value can be given in decimal,
  70. !              hex (preceded with 0x) or octal (preceded with '0').
  71.               The old value can be inserted by typing 'wildchar' (by
  72.               default this is a <Tab> or CTRL-E if 'compatible' is
  73.               set).  See |cmdline-completion|.
  74. *** ../vim-7.4.601/src/version.c    2015-01-27 15:18:55.156333265 +0100
  75. --- src/version.c    2015-01-27 15:49:28.840349899 +0100
  76. ***************
  77. *** 743,744 ****
  78. --- 743,746 ----
  79.   {   /* Add new patch number below this line */
  80. + /**/
  81. +     602,
  82.   /**/
  83.  
  84. -- 
  85. hundred-and-one symptoms of being an internet addict:
  86. 128. You can access the Net -- via your portable and cellular phone.
  87.  
  88.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  89. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  90. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  91.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  92.