diff options
-rw-r--r-- | lib/net/imap.rb | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb index a032a1850d..9de6395236 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -2001,9 +2001,9 @@ module Net BEG_REGEXP = /\G(?:\ (?# 1: SPACE )( +)|\ -(?# 2: NIL )(NIL)(?=[\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+])|\ -(?# 3: NUMBER )(\d+)(?=[\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+])|\ -(?# 4: ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*"\\\[\]+]+)|\ +(?# 2: NIL )(NIL)(?=[\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+])|\ +(?# 3: NUMBER )(\d+)(?=[\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+])|\ +(?# 4: ATOM )([^\x80-\xff(){ \x00-\x1f\x7f%*#{'"'}\\\[\]+]+)|\ (?# 5: QUOTED )"((?:[^\x00\r\n"\\]|\\["\\])*)"|\ (?# 6: LPAR )(\()|\ (?# 7: RPAR )(\))|\ @@ -3486,6 +3486,23 @@ usage: #{$0} [options] <host> EOF end + begin + require 'io/console' + rescue LoadError + def _noecho(&block) + system("stty", "-echo") + begin + yield STDIN + ensure + system("stty", "echo") + end + end + else + def _noecho(&block) + STDIN.noecho(&block) + end + end + def get_password print "password: " begin |