diff --git a/src/dos/drives.cpp b/src/dos/drives.cpp index 3ab038664..c6841adcd 100644 --- a/src/dos/drives.cpp +++ b/src/dos/drives.cpp @@ -298,10 +298,12 @@ void Set_Label(char const * const input, char * const output, bool cdrom) { strncpy(upcasebuf, input, 11); //DBCS_upcase(upcasebuf); /* Another mscdex quirk. Label is not always uppercase. (Daggerfall) */ - (void)cdrom; - while (togo > 0) { if(upcasebuf[vnamePos] == 0) str_end = true; + else if(cdrom && vnamePos == 8 && !str_end && upcasebuf[vnamePos] != '.') { + output[labelPos] = '.'; // add a dot between 8th and 9th character (Descent 2 installer needs this) + labelPos++; + } output[labelPos] = !str_end ? upcasebuf[vnamePos] : 0x0; // Pad empty characters with 0x00 labelPos++; vnamePos++; diff --git a/tests/drives_tests.cpp b/tests/drives_tests.cpp index 60986c309..3b9d1728b 100644 --- a/tests/drives_tests.cpp +++ b/tests/drives_tests.cpp @@ -113,7 +113,7 @@ TEST(Set_Label, Daggerfall) TEST(Set_Label, DaggerfallCD) { std::string output = run_Set_Label("Daggerfall", true); - EXPECT_EQ("Daggerfall", output); + EXPECT_EQ("Daggerfa.ll", output); } TEST(Set_Label, LongerThan11) @@ -124,7 +124,7 @@ TEST(Set_Label, LongerThan11) TEST(Set_Label, LongerThan11CD) { std::string output = run_Set_Label("a123456789AAA", true); - EXPECT_EQ("a123456789A", output); + EXPECT_EQ("a1234567.89A", output); } TEST(Set_Label, ShorterThan8)