]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
`du -D symlink-to-dir' would mistakenly omit the slash in
authorJim Meyering <jim@meyering.net>
Fri, 19 Sep 2003 07:39:04 +0000 (07:39 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 19 Sep 2003 07:39:04 +0000 (07:39 +0000)
lines like this:  24 symlink-to-dir/subdir

(process_file): Fix offset calculation.
Reported by Jeff Sheinberg as Debian bug #211591;
http://bugs.debian.org/205251

src/du.c

index 15b44616a6340fd267b2f3c0fe1661db961384b8..c82fa1a3cd41072e2a3aa99a5bf8773282b1fba9 100644 (file)
--- a/src/du.c
+++ b/src/du.c
@@ -474,7 +474,8 @@ process_file (const char *file, const struct stat *sb, int file_type,
          fwrite (file, arg_length, 1, stdout);
          /* Print everything after what we appended.  */
          fputs (file + arg_length + suffix_length
-                + (file[arg_length + suffix_length] == '/'), stdout);
+                + (file[arg_length - 1] == '/'
+                   && file[arg_length + suffix_length] == '/'), stdout);
        }
       else
        {