* Don't overwrite the history buffer when you issue the same command more than

once.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30953 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-06-03 21:05:29 +00:00
parent ce684bcc33
commit cf2a26ea96
1 changed files with 13 additions and 4 deletions

View File

@ -714,14 +714,23 @@ kernel_debugger_loop(void)
int rc = evaluate_debug_command(line);
if (rc == B_KDEBUG_QUIT)
break; // okay, exit now.
if (rc == B_KDEBUG_QUIT) {
// okay, exit now.
break;
}
// If the command is continuable, remember the current line index.
continuableLine = (rc == B_KDEBUG_CONT ? sCurrentLine : -1);
if (++sCurrentLine >= HISTORY_SIZE)
sCurrentLine = 0;
int previousLine = sCurrentLine - 1;
if (previousLine < 0)
previousLine = HISTORY_SIZE - 1;
// Only use the next slot in the history, if the entries differ
if (strcmp(sLineBuffer[sCurrentLine], sLineBuffer[previousLine])) {
if (++sCurrentLine >= HISTORY_SIZE)
sCurrentLine = 0;
}
}
delete_debug_alloc_pool(allocPool);