mirror of https://github.com/OpenVPN/openvpn-gui
Make sure full config path exists before importing file
parent
46a1bc715c
commit
01051c51be
4
main.c
4
main.c
|
@ -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…
Reference in New Issue