You've already forked linux-packaging-mono
Imported Upstream version 5.10.0.47
Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
parent
88ff76fe28
commit
e46a49ecf1
@ -1102,6 +1102,16 @@ namespace System {
|
||||
}
|
||||
|
||||
public string ReadLine ()
|
||||
{
|
||||
return ReadUntilConditionInternal (true);
|
||||
}
|
||||
|
||||
public string ReadToEnd ()
|
||||
{
|
||||
return ReadUntilConditionInternal (false);
|
||||
}
|
||||
|
||||
private string ReadUntilConditionInternal (bool haltOnNewLine)
|
||||
{
|
||||
if (!inited)
|
||||
Init ();
|
||||
@ -1120,6 +1130,8 @@ namespace System {
|
||||
rl_starty = cursorTop;
|
||||
char eof = (char) control_characters [ControlCharacters.EOF];
|
||||
|
||||
bool treatAsEnterKey;
|
||||
|
||||
do {
|
||||
key = ReadKeyInternal (out fresh);
|
||||
echo = echo || fresh;
|
||||
@ -1128,7 +1140,9 @@ namespace System {
|
||||
if (c == eof && c != 0 && builder.Length == 0)
|
||||
return null;
|
||||
|
||||
if (key.Key != ConsoleKey.Enter) {
|
||||
treatAsEnterKey = haltOnNewLine && (key.Key == ConsoleKey.Enter);
|
||||
|
||||
if (!treatAsEnterKey) {
|
||||
if (key.Key != ConsoleKey.Backspace) {
|
||||
builder.Append (c);
|
||||
} else if (builder.Length > 0) {
|
||||
@ -1142,7 +1156,7 @@ namespace System {
|
||||
// echo fresh keys back to the console
|
||||
if (echo)
|
||||
Echo (key);
|
||||
} while (key.Key != ConsoleKey.Enter);
|
||||
} while (!treatAsEnterKey);
|
||||
|
||||
EchoFlush ();
|
||||
|
||||
|
Reference in New Issue
Block a user