Index: config.cpp
===================================================================
--- config.cpp (revision 10548)
+++ config.cpp (working copy)
@@ -1697,6 +1697,7 @@
{FSSF_PRIVATE, NKeySystemExecutor,L"SilentExternal", &Exec.ExecuteSilentExternal, false},
{FSSF_PRIVATE, NKeySystemExecutor,L"UseAppPath", &Exec.ExecuteUseAppPath, true},
{FSSF_PRIVATE, NKeySystemExecutor,L"UseHomeDir", &Exec.UseHomeDir, true},
+ {FSSF_PRIVATE, NKeySystemExecutor,L"NotQuotedShell", &Exec.strNotQuotedShell, L"TCC.EXE;TCCLE.EXE"},
{FSSF_PRIVATE, NKeyViewer,L"AutoDetectCodePage", &ViOpt.AutoDetectCodePage, true},
{FSSF_PRIVATE, NKeyViewer,L"DefaultCodePage", &ViOpt.DefaultCodePage, GetACP()},
Index: config.hpp
===================================================================
--- config.hpp (revision 10548)
+++ config.hpp (working copy)
@@ -596,6 +596,7 @@
StringOption strExcludeCmds;
BoolOption UseHomeDir; // cd ~
StringOption strHomeDir; // cd ~
+ StringOption strNotQuotedShell;
};
palette Palette;
Index: execute.cpp
===================================================================
--- execute.cpp (revision 10548)
+++ execute.cpp (working copy)
@@ -253,7 +253,9 @@
// нулевой проход - смотрим исключения
// Берем "исключения" из реестра, которые должны исполняться директом,
// например, некоторые внутренние команды ком. процессора.
- auto ExcludeCmdsList(StringToList(Global->Opt->Exec.strExcludeCmds, STLF_UNIQUE));
+ string strExcludeCmds;
+ apiExpandEnvironmentStrings(Global->Opt->Exec.strExcludeCmds, strExcludeCmds);
+ auto ExcludeCmdsList(StringToList(strExcludeCmds, STLF_UNIQUE));
if (std::any_of(CONST_RANGE(ExcludeCmdsList, i) { return i.EqualNoCase(Module); }))
{
@@ -973,9 +975,16 @@
}
else
{
+ string strNotQuotedShell;
+ apiExpandEnvironmentStrings(Global->Opt->Exec.strNotQuotedShell,strNotQuotedShell);
+ auto NotQuotedShellList(StringToList(strNotQuotedShell, STLF_UNIQUE));
+ LPCWSTR lpCmdProcName = wcsrchr(strComspec.c_str(),L'\\');
+ if (lpCmdProcName != nullptr)
+ lpCmdProcName++;
+ bool bQuotedShell = !(std::any_of(CONST_RANGE(NotQuotedShellList, i) { return i.EqualNoCase(lpCmdProcName); }));
QuoteSpace(strNewCmdStr);
bool bDoubleQ = wcspbrk(strNewCmdStr.c_str(), L"&<>()@^|=;, ") != nullptr;
- if (!strNewCmdPar.empty() || bDoubleQ)
+ if ((!strNewCmdPar.empty() || bDoubleQ) && bQuotedShell)
{
ComSpecParams += L"\"";
}
@@ -984,7 +993,7 @@
{
ComSpecParams.append(L" ").append(strNewCmdPar);
}
- if (!strNewCmdPar.empty() || bDoubleQ)
+ if ((!strNewCmdPar.empty() || bDoubleQ) && bQuotedShell)
{
ComSpecParams += L"\"";
}
@@ -1445,7 +1454,11 @@
*/
bool IsBatchExtType(const string& ExtPtr)
{
- auto BatchExtList(StringToList(Global->Opt->Exec.strExecuteBatchType, STLF_UNIQUE));
+ string strExecuteBatchType;
+ apiExpandEnvironmentStrings(Global->Opt->Exec.strExecuteBatchType, strExecuteBatchType);
+ if (strExecuteBatchType.empty())
+ strExecuteBatchType = L".BAT;.CMD";
+ auto BatchExtList(StringToList(strExecuteBatchType, STLF_UNIQUE));
return std::any_of(CONST_RANGE(BatchExtList, i) {return i.EqualNoCase(ExtPtr);});
}