@@ -452,10 +452,11 @@ struct vimoption
452452#define P_NFNAME 0x400000L /* only normal file name chars allowed */
453453#define P_INSECURE 0x800000L /* option was set from a modeline */
454454#define P_PRI_MKRC 0x1000000L /* priority for :mkvimrc (setting option has
455- side effects) */
455+ side effects) */
456456#define P_NO_ML 0x2000000L /* not allowed in modeline */
457457#define P_CURSWANT 0x4000000L /* update curswant required; not needed when
458458 * there is a redraw flag */
459+ #define P_NDNAME 0x8000000L /* only normal dir name chars allowed */
459460
460461#define ISK_LATIN1 (char_u *)"@,48-57,_,192-255"
461462
@@ -992,7 +993,7 @@ static struct vimoption options[] =
992993 (char_u * )NULL , PV_NONE ,
993994#endif
994995 {(char_u * )FALSE, (char_u * )0L } SCRIPTID_INIT },
995- {"dictionary" , "dict" , P_STRING |P_EXPAND |P_VI_DEF |P_ONECOMMA |P_NODUP |P_NFNAME ,
996+ {"dictionary" , "dict" , P_STRING |P_EXPAND |P_VI_DEF |P_ONECOMMA |P_NODUP |P_NDNAME ,
996997#ifdef FEAT_INS_EXPAND
997998 (char_u * )& p_dict , PV_DICT ,
998999#else
@@ -5876,11 +5877,13 @@ did_set_string_option(
58765877 errmsg = e_secure ;
58775878 }
58785879
5879- /* Check for a "normal" file name in some options. Disallow a path
5880- * separator (slash and/or backslash), wildcards and characters that are
5881- * often illegal in a file name. */
5882- else if ((options [opt_idx ].flags & P_NFNAME )
5880+ /* Check for a "normal" directory or file name in some options. Disallow a
5881+ * path separator (slash and/or backslash), wildcards and characters that
5882+ * are often illegal in a file name. */
5883+ else if ((( options [opt_idx ].flags & P_NFNAME )
58835884 && vim_strpbrk (* varp , (char_u * )"/\\*?[|;&<>\r\n" ) != NULL )
5885+ || ((options [opt_idx ].flags & P_NDNAME )
5886+ && vim_strpbrk (* varp , (char_u * )"*?[|;&<>\r\n" ) != NULL ))
58845887 {
58855888 errmsg = e_invarg ;
58865889 }
0 commit comments