]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(dirname): Ignore trailing slashes at end of non-null result.
authorUlrich Drepper <drepper@redhat.com>
Thu, 4 Apr 2002 08:10:41 +0000 (08:10 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 4 Apr 2002 08:10:41 +0000 (08:10 +0000)
misc/dirname.c

index b1a0e0c2ac23772da732d78e339d63c1fc6465a1..94ab1c085f9fb72d8e5d24e37962b01489f60cbb 100644 (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';
     }