@@ -1258,7 +1258,9 @@ TFile *TDirectoryFile::OpenFile(const char *name, Option_t *option,const char *f
12581258// / Create a sub-directory "a" or a hierarchy of sub-directories "a/b/c/...".
12591259// /
12601260// / @param name the name or hierarchy of the subdirectory ("a" or "a/b/c")
1261- // / @param title the title
1261+ // / @param title the title of the directory. For hierarchies, this is only applied
1262+ // / to the innermost directory (so if `name == "a/b/c"` and `title == "my dir"`,
1263+ // / only `c` will have the title `"my dir"`).
12621264// / @param returnExistingDirectory if key-name is already existing, the returned
12631265// / value points to preexisting sub-directory if true and to `nullptr` if false.
12641266// / @return a pointer to the created sub-directory, not to the top sub-directory
@@ -1284,10 +1286,11 @@ TDirectory *TDirectoryFile::mkdir(const char *name, const char *title, Bool_t re
12841286 TDirectoryFile *tmpdir = nullptr ;
12851287 GetObject (workname.Data (), tmpdir);
12861288 if (!tmpdir) {
1287- tmpdir = (TDirectoryFile*)mkdir (workname.Data (),title);
1289+ // We give all intermediate directories a default title, as `title` is only given to the innermost dir.
1290+ tmpdir = (TDirectoryFile *)mkdir (workname.Data (), workname.Data ());
12881291 if (!tmpdir) return nullptr ;
12891292 }
1290- return tmpdir->mkdir (slash + 1 , " " , returnExistingDirectory);
1293+ return tmpdir->mkdir (slash + 1 , title , returnExistingDirectory);
12911294 }
12921295
12931296 TDirectory::TContext ctxt (this );
0 commit comments