File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1775,6 +1775,10 @@ impl DirBuilder {
1775
1775
}
1776
1776
1777
1777
fn create_dir_all ( & self , path : & Path ) -> io:: Result < ( ) > {
1778
+ if path == Path :: new ( "" ) {
1779
+ return Ok ( ( ) )
1780
+ }
1781
+
1778
1782
match self . inner . mkdir ( path) {
1779
1783
Ok ( ( ) ) => return Ok ( ( ) ) ,
1780
1784
Err ( ref e) if e. kind ( ) == io:: ErrorKind :: NotFound => { }
@@ -2302,6 +2306,16 @@ mod tests {
2302
2306
check ! ( fs:: create_dir_all( & Path :: new( "/" ) ) ) ;
2303
2307
}
2304
2308
2309
+ #[ test]
2310
+ fn recursive_mkdir_dot ( ) {
2311
+ check ! ( fs:: create_dir_all( & Path :: new( "." ) ) ) ;
2312
+ }
2313
+
2314
+ #[ test]
2315
+ fn recursive_mkdir_empty ( ) {
2316
+ check ! ( fs:: create_dir_all( & Path :: new( "" ) ) ) ;
2317
+ }
2318
+
2305
2319
#[ test]
2306
2320
fn recursive_rmdir ( ) {
2307
2321
let tmpdir = tmpdir ( ) ;
You can’t perform that action at this time.
0 commit comments