Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape file name commas in startup command #67

Merged
merged 3 commits into from
Nov 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ui: Retain default EEPROM path after generation
  • Loading branch information
mborgerson committed Nov 7, 2020
commit 0f1ba0f71bed0dff6297ab86c6cf86469d6e02a7
1 change: 0 additions & 1 deletion softmmu/vl.c
Original file line number Diff line number Diff line change
Expand Up @@ -3007,7 +3007,6 @@ void qemu_init(int argc, char **argv, char **envp)
fake_argv[fake_argc++] = g_strdup_printf("smbus-storage,file=%s",
escaped_eeprom_path);
free(escaped_eeprom_path);
free((char*)eeprom_path);
} else {
char *msg = g_strdup_printf("Failed to generate eeprom file '%s'. Please check machine settings.", eeprom_path);
xemu_queue_error_message(msg);
Expand Down
8 changes: 7 additions & 1 deletion ui/xemu-settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ const char *xemu_settings_get_path(void)

const char *xemu_settings_get_default_eeprom_path(void)
{
static char *eeprom_path = NULL;
if (eeprom_path != NULL) {
return eeprom_path;
}

char *base = SDL_GetPrefPath("xemu", "xemu");
assert(base != NULL);
size_t base_len = strlen(base);
Expand All @@ -238,7 +243,8 @@ const char *xemu_settings_get_default_eeprom_path(void)
memcpy(path+base_len, name, name_len);
path[final_len-1] = '\0';

return path;
eeprom_path = path;
return eeprom_path;
}

static int xemu_enum_str_to_int(const struct enum_str_map *map, const char *str, int *value)
Expand Down