mirror of
https://github.com/open-simh/simh.git
synced 2026-05-02 06:25:43 +00:00
SCP: Fix potential crash with mixed path separators on Windows
This commit is contained in:
@@ -882,7 +882,8 @@ if ((hFind = FindFirstFileA (cptr, &File)) != INVALID_HANDLE_VALUE) {
|
|||||||
GetFullPathNameA(cptr, sizeof(DirName), DirName, (char **)&c);
|
GetFullPathNameA(cptr, sizeof(DirName), DirName, (char **)&c);
|
||||||
c = strrchr (DirName, '\\');
|
c = strrchr (DirName, '\\');
|
||||||
*c = '\0'; /* Truncate to just directory path */
|
*c = '\0'; /* Truncate to just directory path */
|
||||||
if (!pathsep || (!strcmp (slash, "/*"))) /* Separator wasn't mentioned? */
|
if (!pathsep || /* Separator wasn't mentioned? */
|
||||||
|
(slash && (0 == strcmp (slash, "/*"))))
|
||||||
pathsep = "\\"; /* Default to Windows backslash */
|
pathsep = "\\"; /* Default to Windows backslash */
|
||||||
if (*pathsep == '/') { /* If slash separator? */
|
if (*pathsep == '/') { /* If slash separator? */
|
||||||
while ((c = strchr (DirName, '\\')))
|
while ((c = strchr (DirName, '\\')))
|
||||||
|
|||||||
Reference in New Issue
Block a user