Skip to content

Commit

Permalink
pushd & set corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Apr 27, 2017
1 parent 007ac9c commit 52933e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions far/changelog
@@ -1,3 +1,9 @@
drkns 27.04.2017 20:58:46 +0000 - build 4944

1. Убираем пробелы при обработке pushd.

2. Более корректно убираем кавычки при обработке set.

zg 25.04.2017 12:59:57 +0200 - build 4943

1. исключение при вызове mf.fsplit('a.:',0x4+0x8)
Expand Down
8 changes: 4 additions & 4 deletions far/cmdline.cpp
Expand Up @@ -1190,7 +1190,6 @@ bool CommandLine::ProcessOSCommands(const string& CmdLine, const std::function<v
size_t pos;
auto strCmdLine = CmdLine.substr(3);
RemoveLeadingSpaces(strCmdLine);
Unquote(strCmdLine);

// "set" (display all) or "set var" (display all that begin with "var")
if (strCmdLine.empty() || ((pos = strCmdLine.find(L'=')) == string::npos) || !pos)
Expand All @@ -1201,6 +1200,7 @@ bool CommandLine::ProcessOSCommands(const string& CmdLine, const std::function<v
return false;

string strOut;
Unquote(strCmdLine);

{
const os::env::provider::strings EnvStrings;
Expand All @@ -1226,13 +1226,13 @@ bool CommandLine::ProcessOSCommands(const string& CmdLine, const std::function<v
if (strCmdLine.size() == pos+1) //set var=
{
strCmdLine.resize(pos);
os::env::delete_variable(strCmdLine);
os::env::delete_variable(Unquote(strCmdLine));
}
else
{
const auto strExpandedStr = os::env::expand_strings(strCmdLine.substr(pos + 1));
strCmdLine.resize(pos);
os::env::set_variable(strCmdLine, strExpandedStr);
os::env::set_variable(Unquote(strCmdLine), strExpandedStr);
}

return true;
Expand All @@ -1256,7 +1256,7 @@ bool CommandLine::ProcessOSCommands(const string& CmdLine, const std::function<v
else if (IsCommand(L"PUSHD",false))
{
auto strCmdLine = CmdLine.substr(5);
RemoveLeadingSpaces(strCmdLine);
RemoveExternalSpaces(strCmdLine);

const auto PushDir = m_CurDir;

Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,4943)m4_dnl
m4_define(BUILD,4944)m4_dnl

0 comments on commit 52933e0

Please sign in to comment.