Re: Patch 8.0.0101

2016-11-25 Fir de Conversatie Bram Moolenaar

Daisuke Suzuki wrote:

> > Ah, sorry.  The flag name is a bit confusing, as file name normally
> > means including path separators, but here it really means only the file
> > name.  I think we should add another one for path names.
> > 
> > Should also have a test for this...
> 
> Hi Bram,
> 
> I created a minimal test for 'dictionary'.
> 
>   - 
> https://gist.github.com/daisuzu/3e1436674e82a7ebc3b5747756d8edca#file-add_test-patch
> 
> This test fails with v8.0.0101, but it will succeed if it is equivalent 
> behavior to before v8.0.0100.
> (i.e. without `P_NFNAME`)
> 
> [test results]
> 
> https://travis-ci.org/daisuzu/vim/jobs/178828836
> 
>   From test_dictionary.vim:
>   Executing Test_dictionary()
>   Executed 1 test
>   1 FAILED:
>   Found errors in Test_dictionary():
>   Caught exception in Test_dictionary(): Vim(set):E474: Invalid argument: 
> dictionary=/usr/share/dict/words @ function RunTheTest[13]..Test_dictionary, 
> line 1
> 
> https://travis-ci.org/daisuzu/vim/builds/178830644
> 
>   From test_dictionary.vim:
>   Executing Test_dictionary()
>   Executed 1 test

Thanks for that.  I'll add a few more checks.

-- 
hundred-and-one symptoms of being an internet addict:
46. Your wife makes a new rule: "The computer cannot come to bed."

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.0.0101

2016-11-25 Fir de Conversatie Daisuke Suzuki
> Ah, sorry.  The flag name is a bit confusing, as file name normally
> means including path separators, but here it really means only the file
> name.  I think we should add another one for path names.
> 
> Should also have a test for this...

Hi Bram,

I created a minimal test for 'dictionary'.

  - 
https://gist.github.com/daisuzu/3e1436674e82a7ebc3b5747756d8edca#file-add_test-patch

This test fails with v8.0.0101, but it will succeed if it is equivalent 
behavior to before v8.0.0100.
(i.e. without `P_NFNAME`)

[test results]

https://travis-ci.org/daisuzu/vim/jobs/178828836

  From test_dictionary.vim:
  Executing Test_dictionary()
  Executed 1 test
  1 FAILED:
  Found errors in Test_dictionary():
  Caught exception in Test_dictionary(): Vim(set):E474: Invalid argument: 
dictionary=/usr/share/dict/words @ function RunTheTest[13]..Test_dictionary, 
line 1

https://travis-ci.org/daisuzu/vim/builds/178830644

  From test_dictionary.vim:
  Executing Test_dictionary()
  Executed 1 test


Best regards,
Daisuke Suzuki

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.0.0101

2016-11-25 Fir de Conversatie Bram Moolenaar

Mike Williams wrote:

> On 24/11/2016 20:46, Bram Moolenaar wrote:
> >
> > Patch 8.0.0101
> > Problem:Some options are not strictly checked.
> > Solution:   Add flags for strickter checks.
> > Files:  src/option.c
> >
> >
> > *** ../vim-8.0.0100/src/option.c2016-11-24 18:30:55.715444785 +0100
> > --- src/option.c2016-11-24 21:38:32.823206218 +0100
> > ***
> > *** 992,998 
> > (char_u *)NULL, PV_NONE,
> >   #endif
> > {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
> > ! {"dictionary",  "dict", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP,
> >   #ifdef FEAT_INS_EXPAND
> > (char_u *)&p_dict, PV_DICT,
> >   #else
> > --- 992,998 
> > (char_u *)NULL, PV_NONE,
> >   #endif
> > {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
> > ! {"dictionary",  "dict", 
> > P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NFNAME,
> >   #ifdef FEAT_INS_EXPAND
> > (char_u *)&p_dict, PV_DICT,
> >   #else
> 
> This has broken the dictionary option as you can no longer specify a 
> filepath -
> 
> :set dictionary=a/b
> E474: Invalid argument: dictionary=a/b
> 
> Not surprising as P_NFNAME excludes path separators - should it be 
> extended to do full filepath validation if not normalisation?

Ah, sorry.  The flag name is a bit confusing, as file name normally
means including path separators, but here it really means only the file
name.  I think we should add another one for path names.

Should also have a test for this...

-- 
hundred-and-one symptoms of being an internet addict:
45. You buy a Captain Kirk chair with a built-in keyboard and mouse.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.0.0101

2016-11-25 Fir de Conversatie Mike Williams

Hi

On 24/11/2016 20:46, Bram Moolenaar wrote:


Patch 8.0.0101
Problem:Some options are not strictly checked.
Solution:   Add flags for strickter checks.
Files:  src/option.c


*** ../vim-8.0.0100/src/option.c2016-11-24 18:30:55.715444785 +0100
--- src/option.c2016-11-24 21:38:32.823206218 +0100
***
*** 992,998 
(char_u *)NULL, PV_NONE,
  #endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
! {"dictionary",  "dict", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP,
  #ifdef FEAT_INS_EXPAND
(char_u *)&p_dict, PV_DICT,
  #else
--- 992,998 
(char_u *)NULL, PV_NONE,
  #endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
! {"dictionary",  "dict", 
P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NFNAME,
  #ifdef FEAT_INS_EXPAND
(char_u *)&p_dict, PV_DICT,
  #else


This has broken the dictionary option as you can no longer specify a 
filepath -


:set dictionary=a/b
E474: Invalid argument: dictionary=a/b

Not surprising as P_NFNAME excludes path separators - should it be 
extended to do full filepath validation if not normalisation?


TTFN

Mike
--
Make it too tough for the enemy to get in, and you can't get out!

--
--
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Patch 8.0.0101

2016-11-24 Fir de Conversatie Bram Moolenaar

Patch 8.0.0101
Problem:Some options are not strictly checked.
Solution:   Add flags for strickter checks.
Files:  src/option.c


*** ../vim-8.0.0100/src/option.c2016-11-24 18:30:55.715444785 +0100
--- src/option.c2016-11-24 21:38:32.823206218 +0100
***
*** 992,998 
(char_u *)NULL, PV_NONE,
  #endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
! {"dictionary",  "dict", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP,
  #ifdef FEAT_INS_EXPAND
(char_u *)&p_dict, PV_DICT,
  #else
--- 992,998 
(char_u *)NULL, PV_NONE,
  #endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
! {"dictionary",  "dict", 
P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NFNAME,
  #ifdef FEAT_INS_EXPAND
(char_u *)&p_dict, PV_DICT,
  #else
***
*** 2058,2064 
{(char_u *)NULL, (char_u *)0L}
  #endif
SCRIPTID_INIT},
! {"printexpr", "pexpr",  P_STRING|P_VI_DEF,
  #ifdef FEAT_POSTSCRIPT
(char_u *)&p_pexpr, PV_NONE,
{(char_u *)"", (char_u *)0L}
--- 2058,2064 
{(char_u *)NULL, (char_u *)0L}
  #endif
SCRIPTID_INIT},
! {"printexpr", "pexpr",  P_STRING|P_VI_DEF|P_SECURE,
  #ifdef FEAT_POSTSCRIPT
(char_u *)&p_pexpr, PV_NONE,
{(char_u *)"", (char_u *)0L}
***
*** 7021,7026 
--- 7021,7027 
  
  
  #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
+ /* 'toolbar' */
  else if (varp == &p_toolbar)
  {
if (opt_strings_flags(p_toolbar, p_toolbar_values,
***
*** 7235,7240 
--- 7236,7242 
  #endif
  
  #if defined(FEAT_RENDER_OPTIONS)
+ /* 'renderoptions' */
  else if (varp == &p_rop && gui.in_use)
  {
if (!gui_mch_set_rendering_options(p_rop))
***
*** 7262,7280 
  else
  {
p = NULL;
!   if (varp == &p_ww)
p = (char_u *)WW_ALL;
!   if (varp == &p_shm)
p = (char_u *)SHM_ALL;
!   else if (varp == &(p_cpo))
p = (char_u *)CPO_ALL;
!   else if (varp == &(curbuf->b_p_fo))
p = (char_u *)FO_ALL;
  #ifdef FEAT_CONCEAL
!   else if (varp == &curwin->w_p_cocu)
p = (char_u *)COCU_ALL;
  #endif
!   else if (varp == &p_mouse)
{
  #ifdef FEAT_MOUSE
p = (char_u *)MOUSE_ALL;
--- 7264,7282 
  else
  {
p = NULL;
!   if (varp == &p_ww) /* 'whichwrap' */
p = (char_u *)WW_ALL;
!   if (varp == &p_shm) /* 'shortmess' */
p = (char_u *)SHM_ALL;
!   else if (varp == &(p_cpo)) /* 'cpoptions' */
p = (char_u *)CPO_ALL;
!   else if (varp == &(curbuf->b_p_fo)) /* 'formatoptions' */
p = (char_u *)FO_ALL;
  #ifdef FEAT_CONCEAL
!   else if (varp == &curwin->w_p_cocu) /* 'concealcursor' */
p = (char_u *)COCU_ALL;
  #endif
!   else if (varp == &p_mouse) /* 'mouse' */
{
  #ifdef FEAT_MOUSE
p = (char_u *)MOUSE_ALL;
***
*** 7284,7290 
  #endif
}
  #if defined(FEAT_GUI)
!   else if (varp == &p_go)
p = (char_u *)GO_ALL;
  #endif
if (p != NULL)
--- 7286,7292 
  #endif
}
  #if defined(FEAT_GUI)
!   else if (varp == &p_go) /* 'guioptions' */
p = (char_u *)GO_ALL;
  #endif
if (p != NULL)
*** ../vim-8.0.0100/src/version.c   2016-11-24 18:30:55.715444785 +0100
--- src/version.c   2016-11-24 19:54:59.141485534 +0100
***
*** 766,767 
--- 766,769 
  {   /* Add new patch number below this line */
+ /**/
+ 101,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
42. Your virtual girlfriend finds a new net sweetheart with a larger bandwidth.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.