diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-06-18 19:31:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-18 19:31:42 (GMT) |
commit | 3ac5c1dac99dca4218103847829b93fe3235edb3 (patch) | |
tree | 7503d83c38df5f35b1e0c714fa3ce53bc302520e | |
parent | d0f24b762e23b1b0c069209978aa403acc027cdf (diff) | |
parent | c13144eddc3fca3e112e546dbfa01501da3e711a (diff) | |
download | Doxygen-3ac5c1dac99dca4218103847829b93fe3235edb3.zip Doxygen-3ac5c1dac99dca4218103847829b93fe3235edb3.tar.gz Doxygen-3ac5c1dac99dca4218103847829b93fe3235edb3.tar.bz2 |
Merge pull request #7861 from tttapa/tttapa-patch-1
Don't crash if output subdirectories already exist
-rw-r--r-- | src/util.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/util.cpp b/src/util.cpp index 710de06..8b3f618 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -5023,15 +5023,19 @@ void createSubDirs(QDir &d) int l1,l2; for (l1=0;l1<16;l1++) { - if (!d.mkdir(QCString().sprintf("d%x",l1))) + QCString subdir; + subdir.sprintf("d%x",l1); + if (!d.exists(subdir) && !d.mkdir(subdir)) { - term("Failed to create output directory '%s'\n",(QCString().sprintf("d%x",l1)).data()); + term("Failed to create output directory '%s'\n",subdir.data()); } for (l2=0;l2<256;l2++) { - if (!d.mkdir(QCString().sprintf("d%x/d%02x",l1,l2))) + QCString subsubdir; + subsubdir.sprintf("d%x/d%02x",l1,l2); + if (!d.exists(subsubdir) && !d.mkdir(subsubdir)) { - term("Failed to create output directory '%s'\n",(QCString().sprintf("d%x/d%02x",l1,l2)).data()); + term("Failed to create output directory '%s'\n",subsubdir.data()); } } } |