Quote arbitrary strings in diagnostics.
(from_header): Use locale_quoting_style to quote diagnostics.
(print_header, print_for_mkdir): Quote with quotearg, not quote_copy_string.
}
if (show_omitted_dirs_option
&& current_header->header.typeflag == DIRTYPE)
}
if (show_omitted_dirs_option
&& current_header->header.typeflag == DIRTYPE)
- WARN ((0, 0, _("Omitting %s"), current_file_name));
+ WARN ((0, 0, _("Omitting %s"), quote (current_file_name)));
/* Skip past it in the archive. */
/* Skip past it in the archive. */
- apply_delayed_set_stat ();
+ apply_delayed_set_stat ("");
close_archive ();
names_notfound (); /* print names not found */
}
close_archive ();
names_notfound (); /* print names not found */
}
(data_block->buffer + written - 1));
if (check != written)
{
(data_block->buffer + written - 1));
if (check != written)
{
- ERROR ((0, errno, _("Only wrote %lu of %lu bytes to file %s"),
+ int e = errno;
+ ERROR ((0, e, _("Only wrote %lu of %lu bytes to file %s"),
- (unsigned long) written, current_file_name));
+ (unsigned long) written, quote (current_file_name)));
skip_file (size - written);
break;
}
skip_file (size - written);
break;
}
if (!o)
{
o = clone_quoting_options (0);
if (!o)
{
o = clone_quoting_options (0);
- set_quoting_style (o, c_quoting_style);
+ set_quoting_style (o, locale_quoting_style);
}
while (where0 != lim && ! lim[-1])
lim--;
quotearg_buffer (buf, sizeof buf, where0, lim - where, o);
ERROR ((0, 0,
}
while (where0 != lim && ! lim[-1])
lim--;
quotearg_buffer (buf, sizeof buf, where0, lim - where, o);
ERROR ((0, 0,
- _("Archive contains `%.*s' where numeric %s value expected"),
+ _("Archive contains %.*s where numeric %s value expected"),
(int) sizeof buf, buf, type));
}
(int) sizeof buf, buf, type));
}
/* holds formatted size or major,minor */
char uintbuf[UINTMAX_STRSIZE_BOUND];
int pad;
/* holds formatted size or major,minor */
char uintbuf[UINTMAX_STRSIZE_BOUND];
int pad;
if (block_number_option)
{
if (block_number_option)
{
if (verbose_option <= 1)
{
/* Just the fax, mam. */
if (verbose_option <= 1)
{
/* Just the fax, mam. */
-
- char *quoted_name = quote_copy_string (current_file_name);
-
- if (quoted_name)
- {
- fprintf (stdlis, "%s\n", quoted_name);
- free (quoted_name);
- }
- else
- fprintf (stdlis, "%s\n", current_file_name);
+ fprintf (stdlis, "%s\n", quotearg (current_file_name));
fprintf (stdlis, "%s %s/%s %*s%s %s",
modes, user, group, ugswidth - pad, "", size, time_stamp);
fprintf (stdlis, "%s %s/%s %*s%s %s",
modes, user, group, ugswidth - pad, "", size, time_stamp);
- name = quote_copy_string (current_file_name);
- if (name)
- {
- fprintf (stdlis, " %s", name);
- free (name);
- }
- else
- fprintf (stdlis, " %s", current_file_name);
+ fprintf (stdlis, " %s", quotearg (current_file_name));
switch (current_header->header.typeflag)
{
case SYMTYPE:
switch (current_header->header.typeflag)
{
case SYMTYPE:
- name = quote_copy_string (current_link_name);
- if (name)
- {
- fprintf (stdlis, " -> %s\n", name);
- free (name);
- }
- else
- fprintf (stdlis, " -> %s\n", current_link_name);
+ fprintf (stdlis, " -> %s\n", quotearg (current_link_name));
- name = quote_copy_string (current_link_name);
- if (name)
- {
- fprintf (stdlis, _(" link to %s\n"), name);
- free (name);
- }
- else
- fprintf (stdlis, _(" link to %s\n"), current_link_name);
+ fprintf (stdlis, _(" link to %s\n"), quotearg (current_link_name));
print_for_mkdir (char *pathname, int length, mode_t mode)
{
char modes[11];
print_for_mkdir (char *pathname, int length, mode_t mode)
{
char modes[11];
if (verbose_option > 1)
{
if (verbose_option > 1)
{
fprintf (stdlis, _("block %s: "),
STRINGIFY_BIGINT (current_block_ordinal (), buf));
}
fprintf (stdlis, _("block %s: "),
STRINGIFY_BIGINT (current_block_ordinal (), buf));
}
- name = quote_copy_string (pathname);
- if (name)
- {
- fprintf (stdlis, "%s %*s %.*s\n", modes, ugswidth + DATEWIDTH,
- _("Creating directory:"), length, name);
- free (name);
- }
- else
- fprintf (stdlis, "%s %*s %.*s\n", modes, ugswidth + DATEWIDTH,
- _("Creating directory:"), length, pathname);
+
+ fprintf (stdlis, "%s %*s %.*s\n", modes, ugswidth + DATEWIDTH,
+ _("Creating directory:"), length, quotearg (pathname));