/* When creating a multi-volume archive, each 'bufmap' represents
a member stored (perhaps partly) in the current record buffer.
Bufmaps are form a single-linked list in chronological order.
-
+
After flushing the record to the output media, all bufmaps that
represent fully written members are removed from the list, the
nblocks and sizeleft values in the bufmap_head and start values
flush_archive (void)
{
size_t buffer_level;
-
+
if (access_mode == ACCESS_READ && time_to_start_writing)
{
access_mode = ACCESS_WRITE;
sys_spawn_shell ();
break;
}
- /* FALL THROUGH */
-
+ FALLTHROUGH;
default:
fprintf (stderr, _("Invalid input. Type ? for help.\n"));
}
header = find_next_block ();
if (header->header.typeflag != GNUTYPE_MULTIVOL)
break;
- /* FALL THROUGH */
-
+ FALLTHROUGH;
case GNUTYPE_MULTIVOL:
if (!read_header0 (&dummy))
return false;
quote (bufmap_head->file_name)));
return false;
}
-
+
if (strcmp (continued_file_name, bufmap_head->file_name))
{
if ((archive_format == GNU_FORMAT || archive_format == OLDGNU_FORMAT)
# define GLOBAL extern
#endif
+#if 7 <= __GNUC__
+# define FALLTHROUGH __attribute__ ((__fallthrough__))
+#else
+# define FALLTHROUGH ((void) 0)
+#endif
+
#define TAREXIT_SUCCESS PAXEXIT_SUCCESS
#define TAREXIT_DIFFERS PAXEXIT_DIFFERS
#define TAREXIT_FAILURE PAXEXIT_FAILURE
ERROR ((0, 0, _("%s: Unknown file type '%c', diffed as normal file"),
quotearg_colon (current_stat_info.file_name),
current_header->header.typeflag));
- /* Fall through. */
-
+ FALLTHROUGH;
case AREGTYPE:
case REGTYPE:
case GNUTYPE_SPARSE:
skip_member ();
break;
}
-
- /* Fall through. */
+ FALLTHROUGH;
case HEADER_SUCCESS_EXTENDED:
logical_status = status;
break;
set_next_block_after (current_header);
break;
}
- /* Fall through. */
+ FALLTHROUGH;
case HEADER_END_OF_FILE:
logical_status = HEADER_END_OF_FILE;
break;
{
case HEADER_STILL_UNREAD:
WARN ((0, 0, _("This does not look like a tar archive")));
- /* Fall through. */
-
+ FALLTHROUGH;
case HEADER_SUCCESS:
case HEADER_SUCCESS_EXTENDED:
case HEADER_ZERO_BLOCK:
ERROR ((0, 0, _("Skipping to next header")));
- /* Fall through. */
-
+ FALLTHROUGH;
case HEADER_FAILURE:
break;
}
/* Find the direct ancestor of FILE_NAME in the delayed_set_stat list.
- */
+ */
static struct delayed_set_stat *
find_direct_ancestor (char const *file_name)
{
break;
stp = &st;
}
-
/* The caller tried to open a symbolic link with O_NOFOLLOW.
Fall through, treating it as an already-existing file. */
-
+ FALLTHROUGH;
case EEXIST:
/* Remove an old file, if the options allow this. */
case KEEP_NEWER_FILES:
if (file_newer_p (file_name, stp, ¤t_stat_info))
break;
- /* FALL THROUGH */
-
+ FALLTHROUGH;
case DEFAULT_OLD_FILES:
case NO_OVERWRITE_DIR_OLD_FILES:
case OVERWRITE_OLD_FILES:
struct stat st;
int e = errno;
int res;
-
+
res = (fstatat (chdir_fd, file_name, &st, AT_SYMLINK_NOFOLLOW) == 0 &&
S_ISLNK (st.st_mode) &&
fstatat (chdir_fd, file_name, &st, 0) == 0 &&
if (keep_directory_symlink_option && is_directory_link (file_name))
return 0;
-
+
if (deref_stat (file_name, &st) == 0)
{
current_mode = st.st_mode;
{
char *file_name = *pfile_name;
char *p;
-
+
for (p = file_name; *p && (ISSLASH (*p) || *p == '.'); p++)
;
if (ISSLASH (p[pos]) || p[pos] == 0)
return;
}
-
+
*pfile_name = make_file_name (one_top_level_dir, file_name);
normalize_filename_x (*pfile_name);
}
if (show_omitted_dirs_option)
WARN ((0, 0, _("%s: Omitting"),
quotearg_colon (current_stat_info.file_name)));
- /* Fall through. */
+ FALLTHROUGH;
default:
skip_member ();
continue;
{
case HEADER_STILL_UNREAD:
ERROR ((0, 0, _("This does not look like a tar archive")));
- /* Fall through. */
-
+ FALLTHROUGH;
case HEADER_ZERO_BLOCK:
case HEADER_SUCCESS:
if (block_number_option)
{"no-wildcards-match-slash", NO_WILDCARDS_MATCH_SLASH_OPTION, 0, 0,
N_("wildcards do not match '/'"), GRID+1 },
#undef GRID
-
+
{NULL}
};
if (p->key == key)
return p;
return NULL;
-}
+}
static char const *
file_selection_option_name (int key)
is_file_selection_option (int key)
{
return file_selection_option (key) != NULL;
-}
+}
\f
/* Either NL or NUL, as decided by the --null option. */
static char filename_terminator = '\n';
/* exclude_fnmatch options */
static int include_anchored = EXCLUDE_ANCHORED;
/* Pattern anchoring options used for file inclusion */
-
+
#define EXCLUDE_OPTIONS \
(((wildcards != disable_wildcards) ? EXCLUDE_WILDCARDS : 0) \
| matching_flags \
For simplicity, only a tail pointer of the list is maintained.
*/
-
+
struct name_elt *unconsumed_option_tail;
/* Push an option to the list */
if (unconsumed_option_tail)
{
struct name_elt *elt;
-
+
ERROR ((0, 0, _("The following options were used after any non-optional arguments in archive create or update mode. These options are positional and affect only arguments that follow them. Please, rearrange them properly.")));
elt = unconsumed_option_tail;
ERROR ((0, 0, _("--%s has no effect"),
file_selection_option_name (elt->v.opt.option)));
break;
-
+
default:
break;
}
elt = elt->next;
}
-
+
unconsumed_option_free ();
}
}
struct wordsplit ws;
int i;
struct option_locus loc;
-
+
while (*str && isspace (*str))
++str;
if (*str != '-')
(0, 0, N_("%s: file name read contains nul character"),
quotearg_colon (ent->v.file.name)));
ent->v.file.term = 0;
- /* fall through */
+ FALLTHROUGH;
case file_list_success:
if (!ent->v.file.verbatim)
{
name_list_advance ();
break;
}
- /* fall through */
+ FALLTHROUGH;
case NELT_NAME:
copy_name (ep);
if (unquote_option)
}
unconsumed_option_report ();
-
+
return NULL;
}
/* fall back to "raw" for this and all other files */
hole_detection = HOLE_DETECTION_RAW;
#endif
+ FALLTHROUGH;
case HOLE_DETECTION_RAW:
if (sparse_scan_file_raw (file))
return true;
}
-
+
return false;
}
u = u1;
break;
}
- /* Fall through. */
+ FALLTHROUGH;
case LONGINT_OVERFLOW:
invalid_num = arg;
break;
optloc_save (OC_LISTED_INCREMENTAL, args->loc);
listed_incremental_option = arg;
after_date_option = true;
- /* Fall through. */
-
+ FALLTHROUGH;
case 'G':
/* We are making an incremental dump (FIXME: are we?); save
directories at the beginning of the archive, and include in each
case 'N':
after_date_option = true;
- /* Fall through. */
-
+ FALLTHROUGH;
case NEWER_MTIME_OPTION:
if (TIME_OPTION_INITIALIZED (newer_mtime_option))
USAGE_ERROR ((0, 0, _("More than one threshold date")));
argp_error (state,
_("Options '-[0-7][lmh]' not supported by *this* tar"));
+ exit (EX_USAGE);
#endif /* not DEVICE_PREFIX */
{
case HEADER_STILL_UNREAD:
WARN ((0, 0, _("This does not look like a tar archive")));
- /* Fall through. */
-
+ FALLTHROUGH;
case HEADER_SUCCESS:
case HEADER_ZERO_BLOCK:
ERROR ((0, 0, _("Skipping to next header")));
- /* Fall through. */
-
+ FALLTHROUGH;
case HEADER_FAILURE:
break;