/* Create a tar archive.
Copyright (C) 1985, 1992, 1993, 1994, 1996, 1997, 1999, 2000, 2001,
- 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
Written by John Gilmore, on 1985-08-25.
}
enum exclusion_tag_type
-check_exclusion_tags (char *dirname, const char **tag_file_name)
+check_exclusion_tags (const char *dirname, const char **tag_file_name)
{
static char *tagname;
static size_t tagsize;
struct exclusion_tag *tag;
size_t dlen = strlen (dirname);
- int addslash = dirname[dlen-1] != '/';
+ int addslash = !ISSLASH (dirname[dlen-1]);
char *nptr = NULL;
for (tag = exclusion_tags; tag; tag = tag->next)
if (!incremental_option)
finish_header (st, blk, block_ordinal);
- else if (gnu_list_name->dir_contents)
+ else if (gnu_list_name->directory)
{
if (archive_format == POSIX_FORMAT)
{
- xheader_store ("GNU.dumpdir", st, gnu_list_name->dir_contents);
+ xheader_store ("GNU.dumpdir", st,
+ safe_directory_contents (gnu_list_name->directory));
finish_header (st, blk, block_ordinal);
}
else
const char *buffer, *p_buffer;
block_ordinal = current_block_ordinal ();
- buffer = gnu_list_name->dir_contents;
- if (buffer)
- totsize = dumpdir_size (buffer);
- else
- totsize = 0;
+ buffer = safe_directory_contents (gnu_list_name->directory);
+ totsize = dumpdir_size (buffer);
OFF_TO_CHARS (totsize, blk->header.size);
finish_header (st, blk, block_ordinal);
p_buffer = buffer;
}
memcpy (buffer, p, plen);
if (! ISSLASH (buffer[plen - 1]))
- buffer[plen++] = '/';
- q = gnu_list_name->dir_contents;
+ buffer[plen++] = DIRECTORY_SEPARATOR;
+ q = directory_contents (gnu_list_name->directory);
if (q)
while (*q)
{
/* See if we want only new files, and check if this one is too old to
put in the archive.
-
+
This check is omitted if incremental_option is set *and* the
requested file is not explicitely listed in the command line. */
-
+
if (!(incremental_option && !is_individual_file (p))
&& !S_ISDIR (st->stat.st_mode)
&& OLDER_TAR_STAT_TIME (*st, m)