From 197d62860bb35de83b09072b4d2d8e3579064fe6 Mon Sep 17 00:00:00 2001 From: Themaister Date: Mon, 24 Oct 2011 21:34:30 +0200 Subject: [PATCH] Default screenshot directory. --- ssnes.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ssnes.c b/ssnes.c index 4b262ade1f..7a277de75b 100644 --- a/ssnes.c +++ b/ssnes.c @@ -1248,6 +1248,16 @@ static void fill_pathnames(void) if (!(*g_extern.xml_name)) fill_pathname_noext(g_extern.xml_name, g_extern.basename, ".xml", sizeof(g_extern.xml_name)); + + if (!(*g_settings.screenshot_directory)) + { + strlcpy(g_settings.screenshot_directory, g_extern.basename, sizeof(g_settings.screenshot_directory)); + char *dir = strrchr(g_settings.screenshot_directory, '/'); + if (!dir) + dir = strrchr(g_settings.screenshot_directory, '\\'); + if (dir) + *dir = '\0'; + } } }