Skip to content

Commit

Permalink
gh-1209: Node and 'undefined' in the process.env.foobar.
Browse files Browse the repository at this point in the history
  Seems like Node checks for non-zero GetLastError()
  instead of ERROR_ENVVAR_NOT_FOUND after GetEnvironmentVariable call.
  • Loading branch information
Maximus5 committed Aug 3, 2017
1 parent 865ead3 commit 5324aa0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ConEmuHk/Entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "../common/HandleKeeper.h"
#include "../common/PipeServer.h"
#include "../common/ConEmuInOut.h"
#include "../common/WErrGuard.h"

#include "../ConEmuCD/ExitCodes.h"

Expand Down Expand Up @@ -441,6 +442,8 @@ CESERVER_CONSOLE_MAPPING_HDR* GetConMap(BOOL abForceRecreate/*=FALSE*/)
bool bAnsi = false;
bool bAnsiLog = false;

CLastErrorGuard errGuard;

if (gpConInfo && gpAppMap && !abForceRecreate)
goto wrap;

Expand Down
2 changes: 2 additions & 0 deletions src/ConEmuHk/hkEnvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif

#include "../common/Common.h"
#include "../common/WErrGuard.h"

#include "Ansi.h"
#include "hkEnvironment.h"
Expand All @@ -49,6 +50,7 @@ void CheckVariables()

void CheckAnsiConVar(LPCWSTR asName)
{
CLastErrorGuard errGuard;
bool bAnsi = false;
CEAnsi::GetFeatures(&bAnsi, NULL);

Expand Down

0 comments on commit 5324aa0

Please sign in to comment.