summaryrefslogtreecommitdiffhomepage
path: root/archival/tar.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2005-09-01 11:36:21 +0000
committerRob Landley <rob@landley.net>2005-09-01 11:36:21 +0000
commit92255d60b840184e9418fa29a077be860bcc767b (patch)
treef4bcfa104045484afaad0be5d525fe16c197b304 /archival/tar.c
parent828548ab56ed2dca36daf0dfdbb0644119ecbe2c (diff)
Fix for bug 383: attempting to "tar c /" would error out because stripping
trailing / turns that into an empty string.
Diffstat (limited to 'archival/tar.c')
-rw-r--r--archival/tar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/archival/tar.c b/archival/tar.c
index cf972f41d..585f0629f 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]);