diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2013-10-12 14:45:35 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2013-10-12 14:45:35 (GMT) |
commit | 5d8fc1c198b8c5ccffa67eaddea7398fc2939449 (patch) | |
tree | 1cfdf756a0ceef9a30fd99c10fe3f3b0a41eb193 | |
parent | 93d1c4621df42ee41d7197aca27c8cf2ce8437d7 (diff) | |
download | Doxygen-5d8fc1c198b8c5ccffa67eaddea7398fc2939449.zip Doxygen-5d8fc1c198b8c5ccffa67eaddea7398fc2939449.tar.gz Doxygen-5d8fc1c198b8c5ccffa67eaddea7398fc2939449.tar.bz2 |
Bug 709780 - Copying of files via \image tag can get confused by symlinks at the destination
-rw-r--r-- | src/docparser.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/docparser.cpp b/src/docparser.cpp index 77b7bc0..9bb80ac 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -269,6 +269,14 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type) break; } QCString outputFile = outputDir+"/"+result; + QFileInfo outfi(outputFile); + if (outfi.isSymLink()) + { + QFile::remove(outputFile); + warn_doc_error(g_fileName,doctokenizerYYlineno, + "destination of image %s is a symlink, replacing with image", + qPrint(outputFile)); + } if (outputFile!=inputFile) // prevent copying to ourself { QFile outImage(outputFile.data()); @@ -287,6 +295,10 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type) "could not write output image %s",qPrint(outputFile)); } } + else + { + printf("Source & Destination are the same!\n"); + } } else { |