From aa7aa18cabcbf19d0dd771f86931cf5b0ed405a1 Mon Sep 17 00:00:00 2001 From: Stefanos Kornilios Mitsis Poiitidis Date: Mon, 24 Aug 2015 14:05:51 +0200 Subject: [PATCH] cfg: Create emu.cfg if missing --- core/cfg/cfg.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/cfg/cfg.cpp b/core/cfg/cfg.cpp index 6b7102ce9..aba6669c7 100644 --- a/core/cfg/cfg.cpp +++ b/core/cfg/cfg.cpp @@ -74,6 +74,10 @@ bool cfgOpen() cfgPath=GetPath("/emu.cfg"); FILE* cfgfile = fopen(cfgPath.c_str(),"r"); + if (!cfgfile) { + cfgfile = fopen(cfgPath.c_str(), "wt"); + } + if(!cfgfile) { printf("Unable to open the config file for reading or writing\nfile : %s\n",cfgPath.c_str()); return false;