summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2004-06-27 18:32:14 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2004-06-27 18:32:14 +0000
commite2fe7499b66699cdb86a147e1f8aa11554171b92 (patch)
tree67764a5b562724e535ee3d8d32cc1bdc90df6774 /usr.bin
parent52b8c8cd0062dd5074ec8eec4523d3bba87dd912 (diff)
downloadsrc-test2-e2fe7499b66699cdb86a147e1f8aa11554171b92.tar.gz
src-test2-e2fe7499b66699cdb86a147e1f8aa11554171b92.zip
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tar/write.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/tar/write.c b/usr.bin/tar/write.c
index dc2ddc0326b8..c8cac23d25fe 100644
--- a/usr.bin/tar/write.c
+++ b/usr.bin/tar/write.c
@@ -794,8 +794,15 @@ write_entry(struct bsdtar *bsdtar, struct archive *a, struct stat *st,
}
/* Strip leading '/' unless user has asked us not to. */
- if (pathname && pathname[0] == '/' && !bsdtar->option_absolute_paths)
+ if (pathname && pathname[0] == '/' && !bsdtar->option_absolute_paths) {
+ /* Generate a warning the first time this happens. */
+ if (!bsdtar->warned_lead_slash) {
+ bsdtar_warnc(bsdtar, 0,
+ "Removing leading '/' from member names");
+ bsdtar->warned_lead_slash = 1;
+ }
pathname++;
+ }
archive_entry_set_pathname(entry, pathname);