Skip to content

Commit

Permalink
Merge remote-tracking branch 'source_repo/master' into ci
Browse files Browse the repository at this point in the history
  • Loading branch information
praiskup-mirroring committed Sep 11, 2023
2 parents b875a37 + 78d4ccd commit 4f1e720
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 26 deletions.
4 changes: 3 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GNU tar NEWS - User visible changes. 2023-08-21
GNU tar NEWS - User visible changes. 2023-09-10
Please send GNU tar bug reports to <bug-tar@gnu.org>

version TBD
Expand Down Expand Up @@ -31,6 +31,8 @@ used, command output will be parsed using strptime(3).

** tar no longer uses alloca, fixing an unlikely stack overflow.

** When diagnosing invalid extended headers tar now quotes control characters.


version 1.35 - Sergey Poznyakoff, 2023-07-18

Expand Down
2 changes: 2 additions & 0 deletions THANKS
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ Mads Martin Joergensen mmj@suse.de
Manfred Weichel Manfred.Weichel@mch.sni.de
Manuel Munier Manuel.Munier@loria.fr
Marc Boucher marc@cam.org
Marc Espie marc.espie.openbsd@gmail.com
Marc Ewing marc@redhat.com
Marcin Matuszewski marcin@frodo.nask.org.pl
Marcus Daniels marcus@sysc.pdx.edu
Expand Down Expand Up @@ -535,6 +536,7 @@ Warner Losh imp@boulder.parcplace.com
Warren Dodge warrend@sptekwv3.wv.tek.com
Wayne Christopher wayne@icemcfd.com
Werner Almesberger werner.almesberger@lrc.di.epfl.ch
Wichar Minnaard wicher@gavagai.nl
William Bader william@nscs.fast.net
William J. Eaton wje@hoffman.rstnu.bcm.tmc.edu
William Kucharski kucharsk@netcom.com
Expand Down
32 changes: 10 additions & 22 deletions src/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,33 +1565,21 @@ try_new_volume (void)
}


#define VOLUME_TEXT " Volume "
#define VOLUME_TEXT_LEN (sizeof VOLUME_TEXT - 1)

char *
drop_volume_label_suffix (const char *label)
{
const char *p;
size_t len = strlen (label);

if (len < 1)
return NULL;
static char const VOLUME_TEXT[] = " Volume ";
idx_t VOLUME_TEXT_LEN = sizeof VOLUME_TEXT - 1;
idx_t prefix_len = 0;

for (p = label + len - 1; p > label && isdigit ((unsigned char) *p); p--)
;
if (p > label && p - (VOLUME_TEXT_LEN - 1) > label)
{
p -= VOLUME_TEXT_LEN - 1;
if (memcmp (p, VOLUME_TEXT, VOLUME_TEXT_LEN) == 0)
{
char *s = xmalloc ((len = p - label) + 1);
memcpy (s, label, len);
s[len] = 0;
return s;
}
}
for (idx_t i = 0; label[i]; i++)
if (!isdigit ((unsigned char) label[i]))
prefix_len = i + 1;

return NULL;
ptrdiff_t len = prefix_len - VOLUME_TEXT_LEN;
return (0 <= len && memcmp (label + len, VOLUME_TEXT, VOLUME_TEXT_LEN) == 0
? ximemdup0 (label, len)
: NULL);
}

/* Check LABEL against the volume label, seen as a globbing
Expand Down
3 changes: 2 additions & 1 deletion src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ extern uintmax_t continued_file_size;
extern uintmax_t continued_file_offset;
extern off_t records_written;

char *drop_volume_label_suffix (const char *label);
char *drop_volume_label_suffix (const char *label)
_GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE;

size_t available_space_after (union block *pointer);
off_t current_block_ordinal (void);
Expand Down
4 changes: 2 additions & 2 deletions src/xheader.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,8 @@ decx (void *data, char const *keyword, char const *value, size_t size)
t->decoder (st, keyword, value, size);
else
WARNOPT (WARN_UNKNOWN_KEYWORD,
(0, 0, _("Ignoring unknown extended header keyword '%s'"),
keyword));
(0, 0, _("Ignoring unknown extended header keyword %s"),
quotearg_style (shell_escape_always_quoting_style, keyword)));
}

void
Expand Down

0 comments on commit 4f1e720

Please sign in to comment.