* path.cc (chdir): Avoid trailing dot calculation when chdir == '/' or we end
up with an empty string.
This commit is contained in:
parent
cc631726d3
commit
af5153a036
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Jul 29 13:33:49 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
|
* path.cc (chdir): Avoid trailing dot calculation when chdir == '/'
|
||||||
|
or we end up with an empty string.
|
||||||
|
|
||||||
Sat Jul 29 12:11:33 2000 Christopher Faylor <cgf@cygnus.com>
|
Sat Jul 29 12:11:33 2000 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
* include/cygwin/version.h: Bump DLL minor version number to 5 due
|
* include/cygwin/version.h: Bump DLL minor version number to 5 due
|
||||||
|
|
|
@ -2642,7 +2642,7 @@ chdir (const char *dir)
|
||||||
of dots > 2 here instead of returning an error code. Counts of dots
|
of dots > 2 here instead of returning an error code. Counts of dots
|
||||||
<= 2 are already eliminated by normalize_posix_path. */
|
<= 2 are already eliminated by normalize_posix_path. */
|
||||||
char *last_slash = strrchr (pathbuf, '/');
|
char *last_slash = strrchr (pathbuf, '/');
|
||||||
if (last_slash && strspn (last_slash + 1, ".") == strlen (last_slash + 1))
|
if (last_slash > pathbuf && strspn (last_slash + 1, ".") == strlen (last_slash + 1))
|
||||||
*last_slash = '\0';
|
*last_slash = '\0';
|
||||||
free (cwd_posix);
|
free (cwd_posix);
|
||||||
cwd_posix = strdup (pathbuf);
|
cwd_posix = strdup (pathbuf);
|
||||||
|
|
Loading…
Reference in New Issue