mirror of https://github.com/mgba-emu/mgba.git
Debugger: Fix reading empty lines
This commit is contained in:
parent
e66061ed9e
commit
40c6304cf0
|
@ -76,9 +76,13 @@ const char* _CLIDebuggerEditLineReadLine(struct CLIDebuggerBackend* be, size_t*
|
|||
int count;
|
||||
*len = 0;
|
||||
const char* line = el_gets(elbe->elstate, &count);
|
||||
if (line && count >= 1) {
|
||||
// Crop off newline
|
||||
*len = (size_t) count - 1;
|
||||
if (line) {
|
||||
if (count > 1) {
|
||||
// Crop off newline
|
||||
*len = (size_t) count - 1;
|
||||
} else if (count == 1) {
|
||||
*len = 1;
|
||||
}
|
||||
}
|
||||
return line;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue