diff --git a/src/karchive.cpp b/src/karchive.cpp --- a/src/karchive.cpp +++ b/src/karchive.cpp @@ -981,6 +981,11 @@ linkName += QLatin1String(".lnk"); } #endif + // remove the link name in case it exists, might have changed + // link target or be non-relative + if (QFile::exists(linkName) && linkName != curEntry->symLinkTarget()) { + QFile::remove(linkName); + } QFile symLinkTarget(curEntry->symLinkTarget()); if (!symLinkTarget.link(linkName)) { //qCDebug(KArchiveLog) << "symlink(" << curEntry->symLinkTarget() << ',' << linkName << ") failed:" << strerror(errno);