From: <ps...@us...> - 2010-06-22 14:35:20
|
Revision: 2037 http://znc.svn.sourceforge.net/znc/?rev=2037&view=rev Author: psychon Date: 2010-06-22 14:35:10 +0000 (Tue, 22 Jun 2010) Log Message: ----------- Don't accept extra arguments to znc as a config file name It's much wiser to specify a whole --datadir because two znc instances running on the same datadir but different configs just calls for problems. Patch by DarthGandalf, some messing by me, idea by various. Modified Paths: -------------- trunk/main.cpp Modified: trunk/main.cpp =================================================================== --- trunk/main.cpp 2010-06-21 12:51:37 UTC (rev 2036) +++ trunk/main.cpp 2010-06-22 14:35:10 UTC (rev 2037) @@ -27,7 +27,7 @@ }; static void GenerateHelp(const char *appname) { - CUtils::PrintMessage("USAGE: " + CString(appname) + " [options] [config]"); + CUtils::PrintMessage("USAGE: " + CString(appname) + " [options]"); CUtils::PrintMessage("Options are:"); CUtils::PrintMessage("\t-h, --help List available command line options (this page)"); CUtils::PrintMessage("\t-v, --version Output version information and exit"); @@ -160,7 +160,9 @@ } if (optind < argc) { - sConfig = argv[optind]; + CUtils::PrintError("Specifying a config file as an argument isn't supported anymore."); + CUtils::PrintError("Use --datadir instead."); + return 1; } CZNC* pZNC = &CZNC::Get(); @@ -303,7 +305,6 @@ NULL, NULL, NULL, - NULL, NULL }; int pos = 3; @@ -315,7 +316,6 @@ args[pos++] = strdup("--no-color"); if (bAllowRoot) args[pos++] = strdup("--allow-root"); - args[pos++] = strdup(pZNC->GetConfigFile().c_str()); // The above code adds 4 entries to args tops // which means the array should be big enough This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |