@@ -10013,7 +10013,7 @@ dos_expandpath(
1001310013 if (p [0 ] == '*' && p [1 ] == '*' )
1001410014 starstar = TRUE;
1001510015
10016- starts_with_dot = ( * s == '.' );
10016+ starts_with_dot = * s == '.' || ( flags & EW_DODOT );
1001710017 pat = file_pat_to_reg_pat (s , e , NULL , FALSE);
1001810018 if (pat == NULL )
1001910019 {
@@ -10096,7 +10096,8 @@ dos_expandpath(
1009610096#endif
1009710097 /* Ignore entries starting with a dot, unless when asked for. Accept
1009810098 * all entries found with "matchname". */
10099- if ((p [0 ] != '.' || starts_with_dot )
10099+ if ((p [0 ] != '.' || (starts_with_dot
10100+ && p [1 ] != NUL && (p [1 ] != '.' || p [2 ] != NUL )))
1010010101 && (matchname == NULL
1010110102 || (regmatch .regprog != NULL
1010210103 && vim_regexec (& regmatch , p , (colnr_T )0 ))
@@ -10325,7 +10326,7 @@ unix_expandpath(gap, path, wildoff, flags, didstar)
1032510326 starstar = TRUE;
1032610327
1032710328 /* convert the file pattern to a regexp pattern */
10328- starts_with_dot = ( * s == '.' );
10329+ starts_with_dot = * s == '.' || ( flags & EW_DODOT );
1032910330 pat = file_pat_to_reg_pat (s , e , NULL , FALSE);
1033010331 if (pat == NULL )
1033110332 {
@@ -10374,7 +10375,9 @@ unix_expandpath(gap, path, wildoff, flags, didstar)
1037410375 dp = readdir (dirp );
1037510376 if (dp == NULL )
1037610377 break ;
10377- if ((dp -> d_name [0 ] != '.' || starts_with_dot )
10378+ if ((dp -> d_name [0 ] != '.' || (starts_with_dot
10379+ && dp -> d_name [1 ] != NUL
10380+ && (dp -> d_name [1 ] != '.' || dp -> d_name [2 ] != NUL )))
1037810381 && ((regmatch .regprog != NULL && vim_regexec (& regmatch ,
1037910382 (char_u * )dp -> d_name , (colnr_T )0 ))
1038010383 || ((flags & EW_NOTWILD )
0 commit comments