Commit ebc37ece authored by Urs Fleisch's avatar Urs Fleisch
Browse files

Strip drive part when checking for illegal file name characters on Windows.

parent 91bd260a
......@@ -32,8 +32,11 @@
bool Utils::hasIllegalFileNameCharacters(const QString& fileName)
{
static const char illegalChars[] = "<>:\"|?*";
QString fileNameWithoutDrive(
(QDir::isAbsolutePath(fileName) && fileName.mid(1, 2) == ":/")
? fileName.mid(3) : fileName);
for (const char* chPtr = illegalChars; *chPtr; ++chPtr) {
if (fileName.contains(*chPtr)) {
if (fileNameWithoutDrive.contains(*chPtr)) {
return true;
}
}
......
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