From f3c69d9d21c8b949958669a43a05e021198e8fef Mon Sep 17 00:00:00 2001 From: Jason Hood Date: Sat, 7 Jan 2012 15:34:43 +1000 Subject: [PATCH] Fixed installing into redirected CMD.EXE. --- ANSI.c | 1 + ansicon.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ANSI.c b/ANSI.c index d278877..36556cc 100644 --- a/ANSI.c +++ b/ANSI.c @@ -1089,6 +1089,7 @@ BOOL HookAPIAllMod( PHookFn Hooks, BOOL restore ) } } CloseHandle( hModuleSnap ); + DEBUGSTR( 2, L"%s completed", (restore) ? zUnhooking : zHooking ); return TRUE; } diff --git a/ansicon.c b/ansicon.c index b79a2d3..23267b7 100644 --- a/ansicon.c +++ b/ansicon.c @@ -281,13 +281,13 @@ int main( void ) arg_out: if (run && *cmd == '\0') { - if (!_isatty( 0 )) + if (!shell) + run = FALSE; + else if (!_isatty( 0 )) { *arg = 't'; run = FALSE; } - else if (!shell) - run = FALSE; } if (run)