Check if the name is already used in add_debugger_command*() and reject

duplicate attempt(s).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40611 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Philippe Houdoin 2011-02-22 11:56:57 +00:00
parent a49fe9b849
commit a4c21b1c82

View File

@ -450,9 +450,12 @@ status_t
add_debugger_command_etc(const char* name, debugger_command_hook func,
const char* description, const char* usage, uint32 flags)
{
struct debugger_command *cmd;
bool ambiguous;
debugger_command *cmd = find_debugger_command(name, false, ambiguous);
if (cmd != NULL && ambiguous == false)
return B_NAME_IN_USE;
cmd = (struct debugger_command*)malloc(sizeof(struct debugger_command));
cmd = (debugger_command*)malloc(sizeof(debugger_command));
if (cmd == NULL)
return B_NO_MEMORY;