From c13144eddc3fca3e112e546dbfa01501da3e711a Mon Sep 17 00:00:00 2001 From: tttapa Date: Thu, 18 Jun 2020 15:32:21 +0200 Subject: Don't crash if output subdirectories already exist See doxygen/doxygen#7860 --- src/util.cpp | 12 ++++++++---- 1 file 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()); } } } -- cgit v0.12