Make sure full config path exists before importing file

pull/17/head
Leonardo Basilio 9 years ago
parent 46a1bc715c
commit 01051c51be

@ -29,6 +29,7 @@
#include <prsht.h>
#include <pbt.h>
#include <commdlg.h>
#include <shlobj.h>
#include "tray.h"
#include "openvpn.h"
@ -562,6 +563,9 @@ ImportConfigFile()
TCHAR destination[MAX_PATH];
PTCHAR fileName = source + fn.nFileOffset;
/* make sure full config path exists */
SHCreateDirectoryEx(NULL, o.config_dir, NULL);
_sntprintf_0(destination, _T("%s\\%s"), o.config_dir, fileName);
if (!CopyFile(source, destination, TRUE))

Loading…
Cancel
Save