From 628f29c551f171b40e935fdc3e4572b191122bf8 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Tue, 19 Jul 2011 14:49:34 +0000 Subject: [PATCH] Correctly throw a not-supported error on older ruby git-svn-id: file:///home/svn/framework3/trunk@13223 4d416f70-5f16-0410-b530-b9f4589650da --- lib/rex/compat.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rex/compat.rb b/lib/rex/compat.rb index d1b791c468..69e21dac4d 100644 --- a/lib/rex/compat.rb +++ b/lib/rex/compat.rb @@ -226,9 +226,9 @@ end def self.win32_console2_verify buf = "\x00" * 512 out = Win32API.new("kernel32", "GetStdHandle", ["L"], "L").call(STD_OUTPUT_HANDLE) - res = Win32API.new("kernel32","GetConsoleTitle", ["PL"], "L").call(buf, buf.length-1) - ( res > 0 and buf.index("Console2 command").nil? ) ? false : true -end + res = Win32API.new("kernel32","GetConsoleTitle", ["PL"], "L").call(buf, buf.length-1) rescue 0 + ( res > 0 and buf.index("Console2 command").nil? ) ? false : true +end # # Platform independent socket pair