mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-11 15:27:57 +00:00
Merge pull request #342 from jburkle/datadir_check
Edited init.cpp to include a check that -datadir exists
This commit is contained in:
commit
77ba3ab99c
13
src/init.cpp
13
src/init.cpp
@ -141,10 +141,19 @@ bool AppInit2(int argc, char* argv[])
|
|||||||
|
|
||||||
if (mapArgs.count("-datadir"))
|
if (mapArgs.count("-datadir"))
|
||||||
{
|
{
|
||||||
filesystem::path pathDataDir = filesystem::system_complete(mapArgs["-datadir"]);
|
if (filesystem::is_directory(filesystem::system_complete(mapArgs["-datadir"])))
|
||||||
strlcpy(pszSetDataDir, pathDataDir.string().c_str(), sizeof(pszSetDataDir));
|
{
|
||||||
|
filesystem::path pathDataDir = filesystem::system_complete(mapArgs["-datadir"]);
|
||||||
|
strlcpy(pszSetDataDir, pathDataDir.string().c_str(), sizeof(pszSetDataDir));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error: Specified directory does not exist\n");
|
||||||
|
Shutdown(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ReadConfigFile(mapArgs, mapMultiArgs); // Must be done after processing datadir
|
ReadConfigFile(mapArgs, mapMultiArgs); // Must be done after processing datadir
|
||||||
|
|
||||||
if (mapArgs.count("-?") || mapArgs.count("--help"))
|
if (mapArgs.count("-?") || mapArgs.count("--help"))
|
||||||
|
Loading…
Reference in New Issue
Block a user