From: Jim Meyering Date: Fri, 19 Sep 2003 07:39:04 +0000 (+0000) Subject: `du -D symlink-to-dir' would mistakenly omit the slash in X-Git-Tag: COREUTILS-5_1_0~570 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=969d9407d328f953ab2487da4604228afb906415;p=platform%2Fupstream%2Fcoreutils.git `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 --- diff --git a/src/du.c b/src/du.c index 15b4461..c82fa1a 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 {