about summary refs log tree commit diff
path: root/misc/dirname.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-04-04 08:10:41 +0000
committerUlrich Drepper <drepper@redhat.com>2002-04-04 08:10:41 +0000
commita4ee429b583a5ad70463c89657648a190a65e949 (patch)
treee37a0eb192a63815f3deae9cd002bb53a87fa361 /misc/dirname.c
parent9c449d9d5d33333a970e3aea4bb31f21692b7b58 (diff)
downloadglibc-a4ee429b583a5ad70463c89657648a190a65e949.tar.gz
glibc-a4ee429b583a5ad70463c89657648a190a65e949.tar.xz
glibc-a4ee429b583a5ad70463c89657648a190a65e949.zip
(dirname): Ignore trailing slashes at end of non-null result.
Diffstat (limited to 'misc/dirname.c')
-rw-r--r--misc/dirname.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/dirname.c b/misc/dirname.c
index b1a0e0c2ac..94ab1c085f 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 <drepper@cygnus.com>, 1996.
 
@@ -66,6 +66,8 @@ dirname (char *path)
 	  else
 	    last_slash = path + 1;
 	}
+      else
+	last_slash = runp;
 
       last_slash[0] = '\0';
     }