mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
Use std::string for interpreter_p
The global interpreter_p is a manually-managed 'char *'. This patch changes it to be a std::string instead, and removes some erroneous comments.
This commit is contained in:
@@ -168,15 +168,8 @@ interp_set (struct interp *interp, bool top_level)
|
||||
if (top_level)
|
||||
ui_interp->top_level_interpreter = interp;
|
||||
|
||||
/* We use interpreter_p for the "set interpreter" variable, so we need
|
||||
to make sure we have a malloc'ed copy for the set command to free. */
|
||||
if (interpreter_p != NULL
|
||||
&& strcmp (interp->name (), interpreter_p) != 0)
|
||||
{
|
||||
xfree (interpreter_p);
|
||||
|
||||
interpreter_p = xstrdup (interp->name ());
|
||||
}
|
||||
if (interpreter_p != interp->name ())
|
||||
interpreter_p = interp->name ();
|
||||
|
||||
/* Run the init proc. */
|
||||
if (!interp->inited)
|
||||
|
||||
Reference in New Issue
Block a user