summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-09-19 07:39:04 +0000
committerJim Meyering <jim@meyering.net>2003-09-19 07:39:04 +0000
commit969d9407d328f953ab2487da4604228afb906415 (patch)
treea4c013bc19e6849a032f781d8bf27ac18261ef74 /src
parentff9bb9d85e935d936493d2fdaa8761849e729001 (diff)
downloadcoreutils-969d9407d328f953ab2487da4604228afb906415.tar.xz
`du -D symlink-to-dir' would mistakenly omit the slash in
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
Diffstat (limited to 'src')
-rw-r--r--src/du.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/du.c b/src/du.c
index 15b44616a..c82fa1a3c 100644
--- 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
{