summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorRob Landley2005-09-01 11:36:21 +0000
committerRob Landley2005-09-01 11:36:21 +0000
commit92255d60b840184e9418fa29a077be860bcc767b (patch)
treef4bcfa104045484afaad0be5d525fe16c197b304 /archival
parent828548ab56ed2dca36daf0dfdbb0644119ecbe2c (diff)
downloadbusybox-92255d60b840184e9418fa29a077be860bcc767b.zip
busybox-92255d60b840184e9418fa29a077be860bcc767b.tar.gz
Fix for bug 383: attempting to "tar c /" would error out because stripping
trailing / turns that into an empty string.
Diffstat (limited to 'archival')
-rw-r--r--archival/tar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/archival/tar.c b/archival/tar.c
index cf972f4..585f062 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -795,7 +795,7 @@ int tar_main(int argc, char **argv)
/* TODO: This is the same as in ar, separate function ? */
while (optind < argc) {
char *filename_ptr = last_char_is(argv[optind], '/');
- if (filename_ptr) {
+ if (filename_ptr > argv[optind]) {
*filename_ptr = '\0';
}
tar_handle->accept = llist_add_to(tar_handle->accept, argv[optind]);