Commit 5d8fc1c1 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Bug 709780 - Copying of files via \image tag can get confused by symlinks at the destination

parent 93d1c462
......@@ -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
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment