https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d27e2b0b2399d3d04a347…
commit d27e2b0b2399d3d04a347342a39d95a787750097
Author: Thamatip Chitpong <tangaming123456(a)outlook.com>
AuthorDate: Mon Feb 6 22:47:21 2023 +0700
Commit: Victor Perevertkin <victor(a)perevertkin.ru>
CommitDate: Tue Feb 7 20:53:08 2023 +0100
[WINMM] Revert "Handle playing of files containing a '+' as part of the
filename."
Wine commit: cc5f2b2c766bbe4975d7ee4a7c3b269650cbf874
author: Alexander Puzankov <alxpnv(a)gmail.com>
Mon, 29 Nov 2010 18:15:16 +0000 (21:15 +0300)
committer: Alexandre Julliard <julliard(a)winehq.org>
Wed, 1 Dec 2010 16:16:20 +0000 (17:16 +0100)
---
dll/win32/winmm/mmio.c | 45 +++++++++++++++++++++++----------------------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/dll/win32/winmm/mmio.c b/dll/win32/winmm/mmio.c
index cd8b1da8aca..899b990d994 100644
--- a/dll/win32/winmm/mmio.c
+++ b/dll/win32/winmm/mmio.c
@@ -369,39 +369,40 @@ static FOURCC MMIO_ParseExtA(LPCSTR szFileName)
LPSTR extEnd;
LPSTR extStart;
+ CHAR ext[5];
+
TRACE("(%s)\n", debugstr_a(szFileName));
if (!szFileName)
return ret;
- /* Find the last '.' */
- extStart = strrchr(szFileName,'.');
+ /* Find the last '+' */
+ extEnd = strrchr(szFileName,'+');
- if (!extStart) {
- ERR("No . in szFileName: %s\n", debugstr_a(szFileName));
+ if (!extEnd) {
+ /* No + so just an extension */
+ return ret;
} else {
- CHAR ext[5];
+ /* Find the first '.' before '+' */
+ extStart = extEnd - 1;
+ while (*extStart != '.') {
+ if (extStart == szFileName) {
+ ERR("No extension in szFileName: %s\n",
debugstr_a(szFileName));
+ return ret;
+ }
+ extStart--;
+ }
+ }
- /* Find the '+' afterwards */
- extEnd = strchr(extStart,'+');
- if (extEnd) {
+ if (extEnd - extStart - 1 > 4)
+ WARN("Extension length > 4\n");
+ lstrcpynA(ext, extStart + 1, min(extEnd-extStart,5));
- if (extEnd - extStart - 1 > 4)
- WARN("Extension length > 4\n");
- lstrcpynA(ext, extStart + 1, min(extEnd-extStart,5));
+ TRACE("Got extension: %s\n", debugstr_a(ext));
- } else {
- /* No + so just an extension */
- if (strlen(extStart) > 4) {
- WARN("Extension length > 4\n");
- }
- lstrcpynA(ext, extStart + 1, 5);
- }
- TRACE("Got extension: %s\n", debugstr_a(ext));
+ /* FOURCC codes identifying file-extensions must be uppercase */
+ ret = mmioStringToFOURCCA(ext, MMIO_TOUPPER);
- /* FOURCC codes identifying file-extensions must be uppercase */
- ret = mmioStringToFOURCCA(ext, MMIO_TOUPPER);
- }
return ret;
}