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;
|
int count;
|
||||||
*len = 0;
|
*len = 0;
|
||||||
const char* line = el_gets(elbe->elstate, &count);
|
const char* line = el_gets(elbe->elstate, &count);
|
||||||
if (line && count >= 1) {
|
if (line) {
|
||||||
// Crop off newline
|
if (count > 1) {
|
||||||
*len = (size_t) count - 1;
|
// Crop off newline
|
||||||
|
*len = (size_t) count - 1;
|
||||||
|
} else if (count == 1) {
|
||||||
|
*len = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue