From fbbfe931aed9491ff8f98af5a88326d882b48092 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 9 Jul 2023 11:25:36 -1000 Subject: [PATCH] FIO: Don't try to interpret \ escape characters when unquoting file names The \ character is the directory path separator for native Windows file specifications. --- sim_fio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sim_fio.c b/sim_fio.c index 85a06979..647117ca 100644 --- a/sim_fio.c +++ b/sim_fio.c @@ -367,19 +367,19 @@ return TRUE; static char *_sim_expand_homedir (const char *file, char *dest, size_t dest_size) { uint8 *without_quotes = NULL; -uint32 dsize = 0; errno = 0; if (((*file == '"') && (file[strlen (file) - 1] == '"')) || ((*file == '\'') && (file[strlen (file) - 1] == '\''))) { + size_t offset = 1; + const char *end = &file[strlen (file) - 1]; + char quote = *file; + without_quotes = (uint8*)malloc (strlen (file) + 1); if (without_quotes == NULL) return NULL; - if (SCPE_OK != sim_decode_quoted_string (file, without_quotes, &dsize)) { - free (without_quotes); - errno = EINVAL; - return NULL; - } + strcpy (without_quotes, file + 1); + without_quotes[strlen (without_quotes) - 1] = '\0'; file = (const char*)without_quotes; }