forked from Imagelibrary/binutils-gdb
Corrupted path caused by "cd" command.
gdb/ChangeLog: * cli/cli-cmds.c (cd_command): Use memmove instead of strcpy.
This commit is contained in:
@@ -111,6 +111,10 @@
|
||||
(mips_o32_return_value): Likewise.
|
||||
(mips_o64_return_value): Likewise.
|
||||
|
||||
2012-04-25 Fredrik Hederstierna <fredrikh.hederstierna@securitas-direct.com>
|
||||
|
||||
* cli/cli-cmds.c (cd_command): Use memmove instead of strcpy.
|
||||
|
||||
2012-04-21 Paul Hilfinger <hilfinger@adacore.com>
|
||||
|
||||
* ada-lang.c (ada_evaluate_subexp): Add cases for
|
||||
|
||||
@@ -417,7 +417,7 @@ cd_command (char *dir, int from_tty)
|
||||
{
|
||||
if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.'
|
||||
&& (p[2] == 0 || IS_DIR_SEPARATOR (p[2])))
|
||||
strcpy (p, p + 2);
|
||||
memmove (p, p + 2, strlen (p + 2) + 1);
|
||||
else if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.' && p[2] == '.'
|
||||
&& (p[3] == 0 || IS_DIR_SEPARATOR (p[3])))
|
||||
{
|
||||
@@ -436,7 +436,7 @@ cd_command (char *dir, int from_tty)
|
||||
++p;
|
||||
else
|
||||
{
|
||||
strcpy (q - 1, p + 3);
|
||||
memmove (q - 1, p + 3, strlen (p + 3) + 1);
|
||||
p = q - 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user