Skip to content

Commit

Permalink
[libromdata] J2MEPrivate::loadManifestMF(): Invalidate last_iter if t…
Browse files Browse the repository at this point in the history
…he entry is a duplicate.

We don't want to add the multi-line portions of multi-line entries if the
entry wasn't added in the first place.
  • Loading branch information
GerbilSoft committed Feb 2, 2025
1 parent 192490e commit f18f064
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/libromdata/Handheld/J2ME.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,14 +485,17 @@ int J2MEPrivate::loadManifestMF(void)
// - Gamester.Smb.In.Demand.v1.00.S30.Java.Retail-BiNPDA.jar
// - Midtown Madness 3.jar
// - Space Warrior.jar
/*if (!status.second) {
if (status.second) {
// Entry added.
// Save the iterator for multi-line entries.
last_iter = status.first;
} else {
// Failed to emplace the value. (Duplicate tag?)
m_map.clear();
return -EIO;
}*/

// Needed for multi-line entries.
last_iter = status.first;
/*m_map.clear();
return -EIO;*/
// Invalidate the iterator to prevent a multi-line entry from being added.
last_iter = m_map.end();
}
}

return (unlikely(m_map.empty()) ? -ENOENT : 0);
Expand Down

0 comments on commit f18f064

Please sign in to comment.