Prior to 2.81, string comparisons used strcasecmp, and some games rely on this: Mines of Madness (#68874).
At some point, null termination of string values was removed. Versions from 2.81 onward replaced the strcasecmp with strncasecmp combined with a hacky check that returns the difference in lengths if the result is 0, and 2.81c further replaced strncasecmp with an endian-unsafe compare (and moved the length comparison first, breaking comparison for strings of different lengths). The bugs from these changes have since been fixed.
This could be fixed by having an alternate compare_strings implementation (without exact case/wildcard checks) that checks the next byte after the compare for \0 before returning -1/1. Since there are already version checks in string comparison it's doubtful checking this would add much (if any) overhead right now. I'd like to wait to see if anything else is found affected by this before patching it, but in any case it's a low-hanging fix for the next bugfix release.
Report ID | 780 | Title | String compares prior to 2.81 used strcasecmp() |
Product | Archived MegaZeux Bugs | Status | Fixed (Severity 1 - Low) |
Version | 2.92 | Fixed in | 2.92d |
Introduced In Version | 2.81 | Operating System | All platforms |
Page 1 of 1
Report ID #780: String compares prior to 2.81 used strcasecmp()
#1 Lachesis
Posted 23 July 2019 - 12:48 AM
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
Page 1 of 1
Replies (1 - 2)
#2 Lachesis
Posted 29 April 2020 - 02:51 AM
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
Page 1 of 1
2 User(s) are reading this issue
2 Guests and 0 Anonymous Users
Powered by IP.Tracker 1.3.2 © 2025 IPS, Inc.