From f448865b8a51fbd11b90125b298e8404db32592c Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Fri, 8 Apr 2016 01:53:21 +0300 Subject: [PATCH] Silently ignoring empty lines --- Cocoa/Document.m | 2 +- Core/debugger.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cocoa/Document.m b/Cocoa/Document.m index d1e20af..fbd483d 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -309,7 +309,7 @@ static uint32_t rgbEncode(GB_gameboy_t *gb, unsigned char r, unsigned char g, un - (IBAction)consoleInput:(NSTextField *)sender { NSString *line = [sender stringValue]; - if ([line isEqualToString:@""]) { + if ([line isEqualToString:@""] && lastConsoleInput) { line = lastConsoleInput; } else if (line) { diff --git a/Core/debugger.c b/Core/debugger.c index fe49058..e2d1554 100644 --- a/Core/debugger.c +++ b/Core/debugger.c @@ -610,6 +610,9 @@ next_command: gb->debug_next_command = false; gb->debug_fin_command = false; input = gb->input_callback(gb); + if (!input[0]) { + goto next_command; + } char *command_string = input; char *arguments = strchr(input, ' ');