diff --git a/taglib/fileref.cpp b/taglib/fileref.cpp index 882c2150..8682b55a 100644 --- a/taglib/fileref.cpp +++ b/taglib/fileref.cpp @@ -169,11 +169,9 @@ File *FileRef::create(FileName fileName, bool readAudioProperties, // Ok, this is really dumb for now, but it works for testing. String s; + #ifdef _WIN32 - if((const wchar_t *)fileName) - s = (const wchar_t *)fileName; - else - s = (const char *)fileName; + s = (wcslen((const wchar_t *) fileName) > 0) ? (const wchar_t) fileName : (const char *) fileName; #else s = fileName; #endif diff --git a/taglib/toolkit/tfile.h b/taglib/toolkit/tfile.h index c62f47e8..680125ac 100644 --- a/taglib/toolkit/tfile.h +++ b/taglib/toolkit/tfile.h @@ -36,7 +36,6 @@ namespace TagLib { class Tag; class AudioProperties; - #ifdef _WIN32 class TAGLIB_EXPORT FileName {