From: <jh...@us...> - 2012-04-28 02:00:35
|
Revision: 334 http://etch.svn.sourceforge.net/etch/?rev=334&view=rev Author: jheiss Date: 2012-04-28 02:00:29 +0000 (Sat, 28 Apr 2012) Log Message: ----------- Fix up get_user_confirmation so that it behaves properly Modified Paths: -------------- trunk/client/lib/etch/client.rb Modified: trunk/client/lib/etch/client.rb =================================================================== --- trunk/client/lib/etch/client.rb 2012-04-28 01:31:19 UTC (rev 333) +++ trunk/client/lib/etch/client.rb 2012-04-28 02:00:29 UTC (rev 334) @@ -2315,14 +2315,17 @@ else print "[p|s|q] " end response = $stdin.gets.chomp - if response =~ /p/i || @last_response =~ /p/i - @last_response = response if !response.strip.empty? + if response.empty? + response = @last_response + end + if response =~ /p/i + @last_response = response return CONFIRM_PROCEED - elsif response =~ /s/i || @last_response =~ /s/i - @last_response = response if !response.strip.empty? + elsif response =~ /s/i + @last_response = response return CONFIRM_SKIP - elsif response =~ /q/i || @last_response =~ /q/i - @last_response = response if !response.strip.empty? + elsif response =~ /q/i + @last_response = response return CONFIRM_QUIT end end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |