tar: remove trailing white space from source files

* ChangeLog.1, ChangeLog.CVS, Makefile.am, NEWS, README:
* README-hacking, directory, doc/Makefile.am, doc/dumpdir.texi:
* doc/gendocs_template, doc/intern.texi, doc/mastermenu.el:
* doc/snapshot.texi, doc/sparse.texi, doc/tar-snapshot-edit.texi:
* doc/value.texi, lib/Makefile.am, scripts/backup-specs:
* scripts/dump-remind.in, scripts/tar-snapshot-edit, scripts/tarcat:
* scripts/xsparse.c, src/arith.h, src/buffer.c, src/compare.c:
* src/create.c, src/delete.c, src/exit.c, src/suffix.c, src/tar.c:
* src/tar.h, src/update.c, src/warning.c, src/xheader.c:
* tests/append01.at, tests/append02.at, tests/atlocal.in:
* tests/delete03.at, tests/exclude.at, tests/exclude06.at:
* tests/extrac04.at, tests/extrac05.at, tests/extrac06.at:
* tests/extrac07.at, tests/filerem01.at, tests/filerem02.at:
* tests/incr01.at, tests/incr02.at, tests/incr03.at, tests/incr06.at:
* tests/label02.at, tests/label03.at, tests/label04.at:
* tests/label05.at, tests/link02.at, tests/link03.at:
* tests/listed01.at, tests/listed02.at, tests/long01.at:
* tests/longv7.at, tests/multiv01.at, tests/multiv02.at:
* tests/multiv03.at, tests/multiv05.at, tests/multiv06.at:
* tests/multiv07.at, tests/multiv08.at, tests/options.at:
* tests/options02.at, tests/remfiles03.at, tests/rename01.at:
* tests/rename02.at, tests/rename03.at, tests/rename04.at:
* tests/rename05.at, tests/same-order01.at, tests/same-order02.at:
* tests/shortfile.at, tests/shortupd.at, tests/sparse01.at:
* tests/sparse02.at, tests/sparsemv.at, tests/sparsemvp.at:
* tests/star/README, tests/star/gtarfail2.at:
* tests/star/multi-fail.at:
* tests/star/pax-big-10g.at, tests/star/quicktest.sh:
* tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at:
* tests/update01.at, tests/update02.at, tests/volsize.at:
* tests/volume.at:
Remove trailing spaces and tabs from lines, and remove
trailing empty lines from files.  This makes it a bit easier
to share code among coreutils and other projects that do this.
This commit is contained in:
Paul Eggert
2010-08-19 15:50:07 -07:00
parent 0a694a16e5
commit 0ab5e64ac0
94 changed files with 199 additions and 275 deletions
+1 -1
View File
@@ -22,6 +22,6 @@
blocked in 1 kB boundaries. We'll need arbitrary precision
arithmetic anyway once we get into the 2**64 range, so there's no
point doing anything fancy before then. */
#define TARLONG_FORMAT "%.0f"
typedef double tarlong;
+8 -8
View File
@@ -76,7 +76,7 @@ static bool read_full_records = false;
/* We're reading, but we just read the last block and it's time to update.
Declared in update.c
FIXME: Either eliminate it or move it to common.h.
*/
extern bool time_to_start_writing;
@@ -152,7 +152,7 @@ static struct bufmap *
bufmap_locate (size_t off)
{
struct bufmap *map;
for (map = bufmap_head; map; map = map->next)
{
if (!map->next
@@ -576,7 +576,7 @@ _open_archive (enum access_mode wanted_access)
FATAL_ERROR ((0, 0, _("No archive name given")));
tar_stat_destroy (&current_stat_info);
record_index = 0;
init_buffer ();
@@ -749,7 +749,7 @@ _flush_write (void)
map = map->next;
bufmap_reset (map, map ? (- map->start) : 0);
}
}
}
return status;
}
@@ -1771,7 +1771,7 @@ _gnu_flush_write (size_t buffer_level)
size_t copy_size;
size_t bufsize;
struct bufmap *map;
status = _flush_write ();
if (status != record_size && !multi_volume_option)
archive_write_error (status);
@@ -1788,7 +1788,7 @@ _gnu_flush_write (size_t buffer_level)
}
map = bufmap_locate (status);
if (status % BLOCKSIZE)
{
ERROR ((0, 0, _("write did not end on a block boundary")));
@@ -1811,13 +1811,13 @@ _gnu_flush_write (size_t buffer_level)
copy_ptr = record_start->buffer + status;
copy_size = buffer_level - status;
/* Switch to the next buffer */
record_index = !record_index;
init_buffer ();
inhibit_map = 1;
if (volume_label_option)
add_volume_label ();
+7 -7
View File
@@ -331,7 +331,7 @@ static int
dumpdir_cmp (const char *a, const char *b)
{
size_t len;
while (*a)
switch (*a)
{
@@ -345,7 +345,7 @@ dumpdir_cmp (const char *a, const char *b)
a += len;
b += len;
break;
case 'D':
if (strcmp(a, b))
return 1;
@@ -353,7 +353,7 @@ dumpdir_cmp (const char *a, const char *b)
a += len;
b += len;
break;
case 'R':
case 'T':
case 'X':
@@ -577,8 +577,8 @@ verify_volume (void)
flush_read ();
while (1)
{
enum read_header status = read_header (&current_header,
&current_stat_info,
enum read_header status = read_header (&current_header,
&current_stat_info,
read_header_auto);
if (status == HEADER_FAILURE)
@@ -608,7 +608,7 @@ verify_volume (void)
{
char buf[UINTMAX_STRSIZE_BOUND];
status = read_header (&current_header, &current_stat_info,
status = read_header (&current_header, &current_stat_info,
read_header_auto);
if (status == HEADER_ZERO_BLOCK)
break;
@@ -617,7 +617,7 @@ verify_volume (void)
STRINGIFY_BIGINT (current_block_ordinal (), buf)));
}
}
diff_archive ();
tar_stat_destroy (&current_stat_info);
}
+19 -19
View File
@@ -71,7 +71,7 @@ exclusion_tag_warning (const char *dirname, const char *tagname,
message));
}
enum exclusion_tag_type
enum exclusion_tag_type
check_exclusion_tags (const char *dirname, const char **tag_file_name)
{
static char *tagname;
@@ -80,7 +80,7 @@ check_exclusion_tags (const char *dirname, const char **tag_file_name)
size_t dlen = strlen (dirname);
int addslash = !ISSLASH (dirname[dlen-1]);
size_t noff = 0;
for (tag = exclusion_tags; tag; tag = tag->next)
{
size_t size = dlen + addslash + tag->length + 1;
@@ -263,7 +263,7 @@ to_chars_subst (int negative, int gnu_format, uintmax_t value, size_t valsize,
1. In OLDGNU_FORMAT all strings in a tar header end in \0
2. Incremental archives use oldgnu_header.
Apart from this they are completely identical. */
uintmax_t s = (negsub &= archive_format == GNU_FORMAT) ? - sub : sub;
char subbuf[UINTMAX_STRSIZE_BOUND + 1];
@@ -618,7 +618,7 @@ write_ustar_long_name (const char *name)
size_t length = strlen (name);
size_t i, nlen;
union block *header;
if (length > PREFIX_FIELD_SIZE + NAME_FIELD_SIZE + 1)
{
ERROR ((0, 0, _("%s: file name is too long (max %d); not dumped"),
@@ -713,7 +713,7 @@ write_extended (bool global, struct tar_stat_info *st, union block *old_header)
char *p;
int type;
time_t t;
if (st->xhdr.buffer || st->xhdr.stk == NULL)
return old_header;
@@ -1041,7 +1041,7 @@ dump_regular_file (int fd, struct tar_stat_info *st)
while (size_left > 0)
{
size_t bufsize, count;
blk = find_next_block ();
bufsize = available_space_after (blk);
@@ -1077,7 +1077,7 @@ dump_regular_file (int fd, struct tar_stat_info *st)
size_left),
quotearg_colon (st->orig_file_name),
STRINGIFY_BIGINT (size_left, buf)));
if (! ignore_failed_read_option)
if (! ignore_failed_read_option)
set_exit_status (TAREXIT_DIFFERS);
pad_archive (size_left - (bufsize - count));
return dump_status_short;
@@ -1126,7 +1126,7 @@ dump_dir0 (char *directory,
size_t bufsize;
ssize_t count;
const char *buffer, *p_buffer;
block_ordinal = current_block_ordinal ();
buffer = safe_directory_contents (gnu_list_name->directory);
totsize = dumpdir_size (buffer);
@@ -1134,7 +1134,7 @@ dump_dir0 (char *directory,
finish_header (st, blk, block_ordinal);
p_buffer = buffer;
size_left = totsize;
mv_begin_write (st->file_name, totsize, totsize);
while (size_left > 0)
{
@@ -1173,13 +1173,13 @@ dump_dir0 (char *directory,
{
char *name_buf;
size_t name_size;
switch (check_exclusion_tags (st->orig_file_name, &tag_file_name))
{
case exclusion_tag_all:
/* Handled in dump_file0 */
break;
case exclusion_tag_none:
{
char const *entry;
@@ -1203,7 +1203,7 @@ dump_dir0 (char *directory,
if (!excluded_name (name_buf))
dump_file (name_buf, false, our_device);
}
free (name_buf);
}
break;
@@ -1218,7 +1218,7 @@ dump_dir0 (char *directory,
dump_file (name_buf, false, our_device);
free (name_buf);
break;
case exclusion_tag_under:
exclusion_tag_warning (st->orig_file_name, tag_file_name,
_("contents not dumped"));
@@ -1427,7 +1427,7 @@ file_count_links (struct tar_stat_info *st)
assign_string (&linkname, st->orig_file_name);
transform_name (&linkname, XFORM_LINK);
lp = xmalloc (offsetof (struct link, name)
+ strlen (linkname) + 1);
lp->ino = st->stat.st_ino;
@@ -1435,13 +1435,13 @@ file_count_links (struct tar_stat_info *st)
lp->nlink = st->stat.st_nlink;
strcpy (lp->name, linkname);
free (linkname);
if (! ((link_table
|| (link_table = hash_initialize (0, 0, hash_link,
compare_links, 0)))
&& (duplicate = hash_insert (link_table, lp))))
xalloc_die ();
if (duplicate != lp)
abort ();
lp->nlink--;
@@ -1523,10 +1523,10 @@ dump_file0 (struct tar_stat_info *st, const char *p,
/* 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)
@@ -1589,7 +1589,7 @@ dump_file0 (struct tar_stat_info *st, const char *p,
close (fd);
return;
}
ok = dump_dir (fd, st, top_level, parent_device);
/* dump_dir consumes FD if successful. */
+2 -2
View File
@@ -262,7 +262,7 @@ delete_archive_members (void)
if (current_block == record_end)
flush_archive ();
status = read_header (&current_header, &current_stat_info,
status = read_header (&current_header, &current_stat_info,
read_header_auto);
xheader_decode (&current_stat_info);
@@ -296,7 +296,7 @@ delete_archive_members (void)
set_next_block_after (current_header);
blocks_to_skip = (current_stat_info.stat.st_size
+ BLOCKSIZE - 1) / BLOCKSIZE;
while (record_end - current_block <= blocks_to_skip)
{
blocks_to_skip -= (record_end - current_block);
+1 -1
View File
@@ -1,4 +1,4 @@
/* This file is part of GNU tar.
/* This file is part of GNU tar.
Copyright (C) 2009 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
+2 -3
View File
@@ -27,7 +27,7 @@ struct compression_suffix
};
static struct compression_suffix compression_suffixes[] = {
#define __CAT2__(a,b) a ## b
#define __CAT2__(a,b) a ## b
#define S(s,p) #s, sizeof (#s) - 1, __CAT2__(p,_PROGRAM)
{ S(gz, GZIP) },
{ S(tgz, GZIP) },
@@ -54,7 +54,7 @@ static const char *
find_compression_program (const char *name, const char *defprog)
{
char *suf = strrchr (name, '.');
if (suf)
{
int i;
@@ -80,4 +80,3 @@ set_comression_program_by_suffix (const char *name, const char *defprog)
if (program)
use_compress_program_option = program;
}
+2 -2
View File
@@ -1509,7 +1509,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
{
uintmax_t u;
char *p;
if (xstrtoumax (arg, &p, 10, &u, TAR_SIZE_SUFFIXES) != LONGINT_OK)
USAGE_ERROR ((0, 0, "%s: %s", quotearg_colon (arg),
_("Invalid tape length")));
@@ -1968,7 +1968,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
case RECORD_SIZE_OPTION:
{
uintmax_t u;
if (! (xstrtoumax (arg, NULL, 10, &u, TAR_SIZE_SUFFIXES) == LONGINT_OK
&& u == (size_t) u))
USAGE_ERROR ((0, 0, "%s: %s", quotearg_colon (arg),
+1 -1
View File
@@ -311,7 +311,7 @@ struct tar_stat_info
/* Extended headers */
struct xheader xhdr;
/* For dumpdirs */
bool is_dumpdir; /* Is the member a dumpdir? */
bool skipped; /* The member contents is already read
+6 -6
View File
@@ -114,8 +114,8 @@ update_archive (void)
while (!found_end)
{
enum read_header status = read_header (&current_header,
&current_stat_info,
enum read_header status = read_header (&current_header,
&current_stat_info,
read_header_auto);
switch (status)
@@ -150,14 +150,14 @@ update_archive (void)
else
{
namebuf_t nbuf = namebuf_create (name->name);
for (p = dirp; *p; p += strlen (p) + 1)
addname (namebuf_name (nbuf, p),
0, false, NULL);
namebuf_free (nbuf);
free (dirp);
remname (name);
}
}
@@ -167,7 +167,7 @@ update_archive (void)
remname (name);
}
}
skip_member ();
break;
}
+2 -3
View File
@@ -76,7 +76,7 @@ set_warning_option (const char *arg)
{
int negate = 0;
int option;
if (strcmp (arg, "none") == 0)
{
warning_option = 0;
@@ -88,11 +88,10 @@ set_warning_option (const char *arg)
arg += 3;
}
option = XARGMATCH ("--warning", arg,
option = XARGMATCH ("--warning", arg,
warning_args, warning_types);
if (negate)
warning_option &= ~option;
else
warning_option |= option;
}
+2 -2
View File
@@ -452,7 +452,7 @@ xheader_write_global (struct xheader *xhdr)
if (xhdr->stk)
{
char *name;
xheader_finish (xhdr);
xheader_write (XGLTYPE, name = xheader_ghdr_name (), time (NULL), xhdr);
free (name);
@@ -708,7 +708,7 @@ xheader_read (struct xheader *xhdr, union block *p, size_t size)
if (!p)
FATAL_ERROR ((0, 0, _("Unexpected EOF in archive")));
memcpy (&xhdr->buffer[j], p->buffer, len);
set_next_block_after (p);