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:
Stan Shebs 1995-06-12 20:07:45 +00:00
parent 43b442f17c
commit 2e1cc80191
2 changed files with 21 additions and 8 deletions

View File

@ -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>
* Makefile.in (distclean, realclean): Remove config.cache and

View File

@ -2832,15 +2832,15 @@ cd_command (dir, from_tty)
perror_with_name (dir);
len = strlen (dir);
dir = savestring (dir, len - (len > 1 && dir[len-1] == '/'));
if (dir[0] == '/')
dir = savestring (dir, len - (len > 1 && SLASH_P(dir[len-1])));
if (ROOTED_P(dir))
current_directory = dir;
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);
else
current_directory = concat (current_directory, "/", dir, NULL);
current_directory = concat (current_directory, SLASH_STRING, dir, NULL);
free (dir);
}
@ -2849,17 +2849,17 @@ cd_command (dir, from_tty)
found_real_path = 0;
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);
else if (p[0] == '/' && p[1] == '.' && p[2] == '.'
&& (p[3] == 0 || p[3] == '/'))
else if (SLASH_P (p[0]) && p[1] == '.' && p[2] == '.'
&& (p[3] == 0 || SLASH_P (p[3])))
{
if (found_real_path)
{
/* Search backwards for the directory just before the "/.."
and obliterate it and the "/..". */
char *q = p;
while (q != current_directory && q[-1] != '/')
while (q != current_directory && ! SLASH_P (q[-1]))
--q;
if (q == current_directory)