1
0
mirror of https://github.com/simh/simh.git synced 2026-01-13 23:35:57 +00:00

FIO: Don't try to interpret \ escape characters when unquoting file names

The \ character is the directory path separator for native Windows file
specifications.
This commit is contained in:
Mark Pizzolato 2023-07-09 11:25:36 -10:00
parent e499d09f85
commit fbbfe931ae

View File

@ -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;
}