diff --git a/DataSpec/DNAMP1/DNAMP1.cpp b/DataSpec/DNAMP1/DNAMP1.cpp index 72cdd0f4e..9d5197129 100644 --- a/DataSpec/DNAMP1/DNAMP1.cpp +++ b/DataSpec/DNAMP1/DNAMP1.cpp @@ -136,6 +136,18 @@ void PAKBridge::build() PAKEntryReadStream rs = areaNameEnt->beginReadStream(m_node); areaName.read(rs); areaDeps.name = areaName.getSystemString(FOURCC('ENGL'), 0); + + /* Trim possible trailing whitespace */ + if (areaDeps.name.size()) + { +#if HECL_UCS2 + while (iswblank(areaDeps.name.back())) + areaDeps.name.pop_back(); +#else + while (isblank(areaDeps.name.back())) + areaDeps.name.pop_back(); +#endif + } } if (areaDeps.name.empty()) { diff --git a/DataSpec/DNAMP2/DNAMP2.cpp b/DataSpec/DNAMP2/DNAMP2.cpp index c281a3d33..5006a9037 100644 --- a/DataSpec/DNAMP2/DNAMP2.cpp +++ b/DataSpec/DNAMP2/DNAMP2.cpp @@ -135,6 +135,18 @@ void PAKBridge::build() PAKEntryReadStream rs = areaNameEnt->beginReadStream(m_node); areaName.read(rs); areaDeps.name = areaName.getSystemString(FOURCC('ENGL'), 0); + + /* Trim possible trailing whitespace */ + if (areaDeps.name.size()) + { +#if HECL_UCS2 + while (iswblank(areaDeps.name.back())) + areaDeps.name.pop_back(); +#else + while (isblank(areaDeps.name.back())) + areaDeps.name.pop_back(); +#endif + } } if (areaDeps.name.empty()) {