[ruby/io-console] Ensure to put a newline after password
https://github.com/ruby/io-console/commit/15e36af171
This commit is contained in:
parent
528da4347c
commit
cff8058701
@ -1538,6 +1538,12 @@ puts_call(VALUE io)
|
||||
return rb_io_write(io, rb_default_rs);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
gets_call(VALUE io)
|
||||
{
|
||||
return rb_funcallv(io, id_gets, 0, 0);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
getpass_call(VALUE io)
|
||||
{
|
||||
@ -1610,9 +1616,8 @@ io_getpass(int argc, VALUE *argv, VALUE io)
|
||||
rb_check_arity(argc, 0, 1);
|
||||
prompt(argc, argv, io);
|
||||
rb_check_funcall(io, id_flush, 0, 0);
|
||||
str = str_chomp(rb_funcallv(io, id_gets, 0, 0));
|
||||
puts_call(io);
|
||||
return str;
|
||||
str = rb_ensure(gets_call, io, puts_call, io);
|
||||
return str_chomp(str);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user