File tree Expand file tree Collapse file tree
ApacheMinaSSHD.NET.Wrapper/Abstractions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,21 +125,27 @@ private bool IsVisibleByDefault(string? path)
125125 return false ;
126126 }
127127
128- if ( HiddenNames . Contains ( fileName ) )
128+ if ( HiddenNames . Contains ( fileName ) ||
129+ HiddenNames . Any ( name => fileName . StartsWith ( name + "." , StringComparison . OrdinalIgnoreCase ) ) )
129130 {
130131 return false ;
131132 }
132133
133134 try
134135 {
135- return ! File . GetAttributes ( path ) . HasFlag ( FileAttributes . Hidden ) ;
136+ if ( File . Exists ( path ) || Directory . Exists ( path ) )
137+ {
138+ return ! File . GetAttributes ( path ) . HasFlag ( FileAttributes . Hidden ) ;
139+ }
136140 }
137141 catch ( Exception ex )
138142 {
139143 System . Diagnostics . Debug . WriteLine (
140144 $ "[{ nameof ( AMNetScpFileOpener ) } ] IsVisibleByDefault failed for '{ path } ': { ex . Message } ") ;
141145 return false ;
142146 }
147+
148+ return true ;
143149 }
144150
145151 private static string EnsureTrailingSeparator ( string path )
Original file line number Diff line number Diff line change @@ -323,7 +323,8 @@ protected virtual bool IsVisibleByDefault(string? localPath)
323323 return false ;
324324 }
325325
326- if ( HiddenNames . Contains ( fileName ) )
326+ if ( HiddenNames . Contains ( fileName ) ||
327+ HiddenNames . Any ( name => fileName . StartsWith ( name + "." , StringComparison . OrdinalIgnoreCase ) ) )
327328 {
328329 return false ;
329330 }
You can’t perform that action at this time.
0 commit comments