1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
2002-04-04  Ulrich Drepper  <drepper@redhat.com>

	* misc/dirname.c (dirname): Ignore trailing slashes at end of
	non-null result [PR libc/2600].

	* misc/tst-dirname.c: Add more tests.
This commit is contained in:
Ulrich Drepper
2002-04-04 08:12:33 +00:00
parent 4a10c7fec7
commit d3d48616c1
3 changed files with 15 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* dirname - return directory part of PATH.
Copyright (C) 1996, 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 1996, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@ -66,6 +66,8 @@ dirname (char *path)
else
last_slash = path + 1;
}
else
last_slash = runp;
last_slash[0] = '\0';
}