From d3d48616c177f32363877eea30b06f79a0f8907d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 4 Apr 2002 08:12:33 +0000 Subject: Update. 2002-04-04 Ulrich Drepper * misc/dirname.c (dirname): Ignore trailing slashes at end of non-null result [PR libc/2600]. * misc/tst-dirname.c: Add more tests. --- misc/dirname.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'misc/dirname.c') diff --git a/misc/dirname.c b/misc/dirname.c index b1a0e0c..94ab1c0 100644 --- a/misc/dirname.c +++ b/misc/dirname.c @@ -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 , 1996. @@ -66,6 +66,8 @@ dirname (char *path) else last_slash = path + 1; } + else + last_slash = runp; last_slash[0] = '\0'; } -- cgit v1.1