@@ -458,10 +458,11 @@ struct vimoption
458458#define P_NFNAME 0x400000L /* only normal file name chars allowed */
459459#define P_INSECURE 0x800000L /* option was set from a modeline */
460460#define P_PRI_MKRC 0x1000000L /* priority for :mkvimrc (setting option has
461- side effects) */
461+ side effects) */
462462#define P_NO_ML 0x2000000L /* not allowed in modeline */
463463#define P_CURSWANT 0x4000000L /* update curswant required; not needed when
464464 * there is a redraw flag */
465+ #define P_NDNAME 0x8000000L /* only normal dir name chars allowed */
465466
466467#define ISK_LATIN1 (char_u *)"@,48-57,_,192-255"
467468
@@ -1004,7 +1005,7 @@ static struct vimoption options[] =
10041005 (char_u * )NULL , PV_NONE ,
10051006#endif
10061007 {(char_u * )FALSE, (char_u * )0L } SCRIPTID_INIT },
1007- {"dictionary" , "dict" , P_STRING |P_EXPAND |P_VI_DEF |P_ONECOMMA |P_NODUP ,
1008+ {"dictionary" , "dict" , P_STRING |P_EXPAND |P_VI_DEF |P_ONECOMMA |P_NODUP | P_NDNAME ,
10081009#ifdef FEAT_INS_EXPAND
10091010 (char_u * )& p_dict , PV_DICT ,
10101011#else
@@ -2111,7 +2112,7 @@ static struct vimoption options[] =
21112112 {(char_u * )NULL , (char_u * )0L }
21122113#endif
21132114 SCRIPTID_INIT },
2114- {"printexpr" , "pexpr" , P_STRING |P_VI_DEF ,
2115+ {"printexpr" , "pexpr" , P_STRING |P_VI_DEF | P_SECURE ,
21152116#ifdef FEAT_POSTSCRIPT
21162117 (char_u * )& p_pexpr , PV_NONE ,
21172118 {(char_u * )"" , (char_u * )0L }
@@ -2712,7 +2713,7 @@ static struct vimoption options[] =
27122713 {"textwidth" , "tw" , P_NUM |P_VI_DEF |P_VIM |P_RBUF ,
27132714 (char_u * )& p_tw , PV_TW ,
27142715 {(char_u * )0L , (char_u * )0L } SCRIPTID_INIT },
2715- {"thesaurus" , "tsr" , P_STRING |P_EXPAND |P_VI_DEF |P_ONECOMMA |P_NODUP ,
2716+ {"thesaurus" , "tsr" , P_STRING |P_EXPAND |P_VI_DEF |P_ONECOMMA |P_NODUP | P_NDNAME ,
27162717#ifdef FEAT_INS_EXPAND
27172718 (char_u * )& p_tsr , PV_TSR ,
27182719#else
@@ -5961,11 +5962,13 @@ did_set_string_option(
59615962 errmsg = e_secure ;
59625963 }
59635964
5964- /* Check for a "normal" file name in some options. Disallow a path
5965- * separator (slash and/or backslash), wildcards and characters that are
5966- * often illegal in a file name. */
5967- else if ((options [opt_idx ].flags & P_NFNAME )
5968- && vim_strpbrk (* varp , (char_u * )"/\\*?[|<>" ) != NULL )
5965+ /* Check for a "normal" directory or file name in some options. Disallow a
5966+ * path separator (slash and/or backslash), wildcards and characters that
5967+ * are often illegal in a file name. */
5968+ else if (((options [opt_idx ].flags & P_NFNAME )
5969+ && vim_strpbrk (* varp , (char_u * )"/\\*?[|;&<>\r\n" ) != NULL )
5970+ || ((options [opt_idx ].flags & P_NDNAME )
5971+ && vim_strpbrk (* varp , (char_u * )"*?[|;&<>\r\n" ) != NULL ))
59695972 {
59705973 errmsg = e_invarg ;
59715974 }
@@ -7111,6 +7114,7 @@ did_set_string_option(
71117114
71127115
71137116#if defined(FEAT_TOOLBAR ) && !defined(FEAT_GUI_W32 )
7117+ /* 'toolbar' */
71147118 else if (varp == & p_toolbar )
71157119 {
71167120 if (opt_strings_flags (p_toolbar , p_toolbar_values ,
@@ -7335,6 +7339,7 @@ did_set_string_option(
73357339#endif
73367340
73377341#if defined(FEAT_RENDER_OPTIONS )
7342+ /* 'renderoptions' */
73387343 else if (varp == & p_rop && gui .in_use )
73397344 {
73407345 if (!gui_mch_set_rendering_options (p_rop ))
@@ -7362,19 +7367,19 @@ did_set_string_option(
73627367 else
73637368 {
73647369 p = NULL ;
7365- if (varp == & p_ww )
7370+ if (varp == & p_ww ) /* 'whichwrap' */
73667371 p = (char_u * )WW_ALL ;
7367- if (varp == & p_shm )
7372+ if (varp == & p_shm ) /* 'shortmess' */
73687373 p = (char_u * )SHM_ALL ;
7369- else if (varp == & (p_cpo ))
7374+ else if (varp == & (p_cpo )) /* 'cpoptions' */
73707375 p = (char_u * )CPO_ALL ;
7371- else if (varp == & (curbuf -> b_p_fo ))
7376+ else if (varp == & (curbuf -> b_p_fo )) /* 'formatoptions' */
73727377 p = (char_u * )FO_ALL ;
73737378#ifdef FEAT_CONCEAL
7374- else if (varp == & curwin -> w_p_cocu )
7379+ else if (varp == & curwin -> w_p_cocu ) /* 'concealcursor' */
73757380 p = (char_u * )COCU_ALL ;
73767381#endif
7377- else if (varp == & p_mouse )
7382+ else if (varp == & p_mouse ) /* 'mouse' */
73787383 {
73797384#ifdef FEAT_MOUSE
73807385 p = (char_u * )MOUSE_ALL ;
@@ -7384,7 +7389,7 @@ did_set_string_option(
73847389#endif
73857390 }
73867391#if defined(FEAT_GUI )
7387- else if (varp == & p_go )
7392+ else if (varp == & p_go ) /* 'guioptions' */
73887393 p = (char_u * )GO_ALL ;
73897394#endif
73907395 if (p != NULL )
0 commit comments