Mail Archives: djgpp-workers/2000/08/22/08:05:42
Again, not much could be said there, except that relinked
bash now makes 'cd link' smoothly.
Any comments?
Laurynas
Index: chdir.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/unistd/chdir.c,v
retrieving revision 1.3
diff -u -r1.3 chdir.c
--- chdir.c 1998/12/13 13:09:46 1.3
+++ chdir.c 2000/08/22 12:02:27
@@ -1,13 +1,17 @@
+/* Copyright (C) 2000 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
#include <libc/stubs.h>
+#include <libc/symlink.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <go32.h>
-#include <ctype.h>
#include <dpmi.h>
+#include <stdio.h>
+#include <limits.h>
#include <libc/dosio.h>
#include <libc/farptrgs.h>
@@ -16,20 +20,26 @@
{
__dpmi_regs r;
int drv_no = -1;
+ char real_name[FILENAME_MAX];
+ char path[FILENAME_MAX];
- if (mydirname == 0)
+ if (!__solve_symlinks(mydirname, real_name))
+ return -1;
+ _fixpath(real_name, path);
+
+ if (path == 0)
{
errno = EINVAL;
return -1;
}
- if (mydirname[0] == 0)
+ if (path[0] == 0)
{
errno = ENOENT;
return -1;
}
- _put_path(mydirname);
+ _put_path(path);
/* _put_path performs some magic conversions of file names, so
the path in the transfer buffer can include a drive even though
- Raw text -