mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-23 01:03:28 +08:00
Windows support bits from Steve Chamberlain <sac@slash.cygnus.com>.
* defs.h: Don't declare strchr and friends if WIN32. (DIRNAME_SEPARATOR): Move here from source.c. (SLASH_P, SLASH_CHAR, SLASH_STRING, ROOTED_P): New macros, symbolic definitions for filename bits. * top.c (cd_command): Use these. * source.c (mod_path, openp): Ditto. * terminal.h: Disable termio/sgtty definitions if WIN32. * findvar.c (registers_changed): Call registers_changed_hook if it is defined.
This commit is contained in:
parent
43b442f17c
commit
2e1cc80191
@ -1,3 +1,16 @@
|
|||||||
|
Mon Jun 12 12:48:13 1995 Stan Shebs <shebs@andros.cygnus.com>
|
||||||
|
|
||||||
|
Windows support bits from Steve Chamberlain <sac@slash.cygnus.com>.
|
||||||
|
* defs.h: Don't declare strchr and friends if WIN32.
|
||||||
|
(DIRNAME_SEPARATOR): Move here from source.c.
|
||||||
|
(SLASH_P, SLASH_CHAR, SLASH_STRING, ROOTED_P): New macros,
|
||||||
|
symbolic definitions for filename bits.
|
||||||
|
* top.c (cd_command): Use these.
|
||||||
|
* source.c (mod_path, openp): Ditto.
|
||||||
|
* terminal.h: Disable termio/sgtty definitions if WIN32.
|
||||||
|
* findvar.c (registers_changed): Call registers_changed_hook
|
||||||
|
if it is defined.
|
||||||
|
|
||||||
Mon Jun 12 12:22:05 1995 J.T. Conklin <jtc@rtl.cygnus.com>
|
Mon Jun 12 12:22:05 1995 J.T. Conklin <jtc@rtl.cygnus.com>
|
||||||
|
|
||||||
* Makefile.in (distclean, realclean): Remove config.cache and
|
* Makefile.in (distclean, realclean): Remove config.cache and
|
||||||
|
16
gdb/top.c
16
gdb/top.c
@ -2832,15 +2832,15 @@ cd_command (dir, from_tty)
|
|||||||
perror_with_name (dir);
|
perror_with_name (dir);
|
||||||
|
|
||||||
len = strlen (dir);
|
len = strlen (dir);
|
||||||
dir = savestring (dir, len - (len > 1 && dir[len-1] == '/'));
|
dir = savestring (dir, len - (len > 1 && SLASH_P(dir[len-1])));
|
||||||
if (dir[0] == '/')
|
if (ROOTED_P(dir))
|
||||||
current_directory = dir;
|
current_directory = dir;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (current_directory[0] == '/' && current_directory[1] == '\0')
|
if (SLASH_P (current_directory[0]) && current_directory[1] == '\0')
|
||||||
current_directory = concat (current_directory, dir, NULL);
|
current_directory = concat (current_directory, dir, NULL);
|
||||||
else
|
else
|
||||||
current_directory = concat (current_directory, "/", dir, NULL);
|
current_directory = concat (current_directory, SLASH_STRING, dir, NULL);
|
||||||
free (dir);
|
free (dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2849,17 +2849,17 @@ cd_command (dir, from_tty)
|
|||||||
found_real_path = 0;
|
found_real_path = 0;
|
||||||
for (p = current_directory; *p;)
|
for (p = current_directory; *p;)
|
||||||
{
|
{
|
||||||
if (p[0] == '/' && p[1] == '.' && (p[2] == 0 || p[2] == '/'))
|
if (SLASH_P (p[0]) && p[1] == '.' && (p[2] == 0 || SLASH_P (p[2])))
|
||||||
strcpy (p, p + 2);
|
strcpy (p, p + 2);
|
||||||
else if (p[0] == '/' && p[1] == '.' && p[2] == '.'
|
else if (SLASH_P (p[0]) && p[1] == '.' && p[2] == '.'
|
||||||
&& (p[3] == 0 || p[3] == '/'))
|
&& (p[3] == 0 || SLASH_P (p[3])))
|
||||||
{
|
{
|
||||||
if (found_real_path)
|
if (found_real_path)
|
||||||
{
|
{
|
||||||
/* Search backwards for the directory just before the "/.."
|
/* Search backwards for the directory just before the "/.."
|
||||||
and obliterate it and the "/..". */
|
and obliterate it and the "/..". */
|
||||||
char *q = p;
|
char *q = p;
|
||||||
while (q != current_directory && q[-1] != '/')
|
while (q != current_directory && ! SLASH_P (q[-1]))
|
||||||
--q;
|
--q;
|
||||||
|
|
||||||
if (q == current_directory)
|
if (q == current_directory)
|
||||||
|
Loading…
Reference in New Issue
Block a user