#50: pass not yet saved options to script

This commit is contained in:
Andrey Prygunkov
2017-03-20 20:59:34 +01:00
parent ffb16aa7bb
commit e839db7107
6 changed files with 42 additions and 12 deletions

View File

@@ -198,14 +198,15 @@ void ScriptController::PrepareEnvOptions(const char* stripPrefix)
for (Options::OptEntry& optEntry : g_Options->GuardOptEntries())
{
const char* value = GetOptValue(optEntry.GetName(), optEntry.GetValue());
if (stripPrefix && !strncmp(optEntry.GetName(), stripPrefix, prefixLen) &&
(int)strlen(optEntry.GetName()) > prefixLen)
{
SetEnvVarSpecial("NZBPO", optEntry.GetName() + prefixLen, optEntry.GetValue());
SetEnvVarSpecial("NZBPO", optEntry.GetName() + prefixLen, value);
}
else if (!stripPrefix)
{
SetEnvVarSpecial("NZBOP", optEntry.GetName(), optEntry.GetValue());
SetEnvVarSpecial("NZBOP", optEntry.GetName(), value);
}
}
}