Sergey Poznyakoff
5c713540e3
Update copyright years
2022-01-02 10:25:29 +02:00
Sergey Poznyakoff
193eb8f81d
transform: fix replacement of particular pattern instance
...
This fixes handling of expressions like 's/s/@/2'
Fix suggested by Anthony Heading.
* src/transform.c (_single_transform_name_to_obstack): Avoid duplicating
initial prefix if replace is not needed.
2021-08-28 09:57:26 +03:00
Sergey Poznyakoff
afa743ac23
Update copyright years
2021-01-06 17:55:16 +02:00
Paul Eggert
dd1a6bd37a
tar: avoid read overrun
...
Problem reported by Timotej Kapus in:
https://lists.gnu.org/r/bug-tar/2020-05/msg00001.html
* src/transform.c (parse_transform_expr):
Diagnose ‘--transform='s'’ instead of continuing past '\0'.
2020-05-19 11:52:26 -07:00
Sergey Poznyakoff
8d90723d30
Update copyright years
2020-02-08 13:21:13 +02:00
Sergey Poznyakoff
2684c88a49
Version 1.31
2019-01-02 20:20:28 +02:00
Sergey Poznyakoff
eae48289c0
Fix improper memory access
...
Bug reported in
http://lists.gnu.org/archive/html/bug-tar/2018-12/msg00009.html
* src/transform.c (parse_transform_expr): Check if re is not empty
before accessing its last byte.
2018-12-21 13:54:11 +02:00
Pavel Raiskup
577dc34565
Avoid some resource leaks
...
* src/incremen.c (store_rename): Free temp_name, leaked before for
each renamed directory with --listed-incremental.
* src/transform.c (add_literal_segment): Tighten arguments by
const.
(parse_transform_expr): Free 'str', leaked storage for each
--transform option before.
* src/utf8.c (utf8_convert): Deallocate buffer for failed iconv()
call so callers don't have to.
2018-07-31 12:06:09 +03:00
Jim Meyering
ccef8581b8
maint: avoid warnings from upcoming GCC8
...
* src/transform.c (_single_transform_name_to_obstack): Mark with
FALLTHROUGH statement rather than /* FALL THROUGH */ comment.
Only the former works with gcc-8.
* src/extract.c (maybe_recoverable): Call abort to tell gcc-8 that
this code is unreachable.
2018-04-07 10:36:23 +03:00
Sergey Poznyakoff
30fe67226a
Update copyright years
2017-01-02 14:49:55 +02:00
Sergey Poznyakoff
8980ecd62d
Update copyright years
2016-01-20 11:29:17 +02:00
Sergey Poznyakoff
63f2e969dd
Allow escaped delimiters in transform expressions.
...
Patch provided by Charles McGarvey and Flavio Poletti.
* src/transform.c (parse_transform_expr): Allow escaped delimiters
in transform expressions.
* tests/xform02.at: New test case.
* tests/Makefile.am: Add xform02.at
* tests/testsuite.at: Include xform02.at
* THANKS: Update.
2016-01-20 11:16:02 +02:00
Sergey Poznyakoff
45ccda1193
Update copyright years.
2014-01-30 13:54:15 +02:00
Paul Eggert
cd7bdd4076
maint: update copyrights for 2013 and as per current GNU standards
2012-12-31 13:17:15 -08:00
Paul Eggert
8ebbef8a15
tar: remove unused externs, or make them static
...
* src/buffer.c (record_buffer_aligned, flush_write_ptr, flush_read_ptr)
(duration):
* src/list.c (recent_global_header):
* src/unlink.c (deferred_unlink_delay):
* src/transform.c (transform_flags):
* src/xattrs.c (acl_get_file_at, acl_set_file_at, file_has_acl_at):
Now static.
* src/common.h (rmt_command_option): Remove; unused.
* src/tar.c (check_links_option, allocated_archive_names):
Move decls here from common.h; these are now static.
2012-12-19 12:34:24 -08:00
Paul Eggert
debc485626
tar: quote 'like this', not `like this'
...
This fixes some test failures recently introduced by gnulib updates
prompted by recent changes to the GNU coding standards,
which now advise to use quotes 'like this' or "like this"
rather than `like this'.
* NEWS: Document this.
* README, README-hacking, doc/Makefile.am, scripts/backup.in:
* scripts/backup.sh.in, scripts/dump-remind.in:
* src/buffer.c, src/checkpoint.c, src/create.c, src/incremen.c:
* src/misc.c, src/names.c, src/sparse.c, src/transform.c:
* tests/incr02.at, tests/incremental.at, tests/multiv08.at:
* tests/sparse04.at, tests/star/README, tests/update01.at:
Quote 'like this' in comments.
* src/tar.h:
Quote "like this" in comments, when quoting English phrases rather
than code.
* configure.ac:
* scripts/xsparse.c (get_var, read_xheader, main):
* src/compare.c (diff_archive):
* src/extract.c (prepare_to_extract):
* src/tar.c (request_stdin, tar_set_quoting_style, doc, options)
(set_subcommand_option, report_textual_dates, parse_opt)
(decode_options, main):
* src/xheader.c (decx):
Quote 'like this' in diagnostics.
* doc/tar.texi (list, warnings, override)
(Selecting Archive Members, quoting styles, after, hard links)
(Sparse Recovery, Multi-Volume Archives, label):
Adjust documentation to match new output.
* tests/backup01.at, tests/incr01.at, tests/incr04.at:
* tests/label04.at, tests/label05.at, tests/link03.at:
* tests/listed02.at, tests/multiv03.at, tests/multiv05.at:
* tests/rename01.at, tests/rename02.at, tests/rename03.at:
* tests/volume.at:
Adjust tests to match new quoting behavior.
2012-01-18 00:25:23 -08:00
Sergey Poznyakoff
73d0d1a0f8
Issue a warning if the archive being compared contais transformed file names.
...
* src/common.h (transform_program_p): New proto.
* src/transform.c (transform_program_p): New function.
* src/compare.c (verify_volume): Warn if the archive contains
transformed file names.
2010-11-15 11:22:27 +02:00
Paul Eggert
f6edb92580
Remove some lint, found by gcc -W etc.
...
* src/common.h (label_notfound): New decl.
* src/buffer.c (set_volume_start_time, compress_type):
(guess_seekable_archive, open_compressed_archive, init_buffer):
(_flush_write, archive_is-dev, increase_volume_number):
(change_tape_menu, try_new_volume, add_chunk_header):
(multi_volume_sync):
Declare as 'static' if it's not exported.
Use function prototype (void) rather than old-style ().
* src/checkpoint.c (expand_checkpoint_string): Likewise.
* src/incremen.c (dirlist_replace_prefix, makedumpdir, read_incr_db_2):
Likewise.
* src/list.c (print_volume_label): Likewise.
* src/misc.c (normalize_filename_x): Likewise.
* src/names.c (make_name, free_name, check_name_alloc, name_next_elt):
Likewise.
* src/tar.c (tar_list_quoting_style, add_exclude_array):
(set_stat_signal): Likewise.
* src/transform.c (new_transform, _single_transform_name_to_obstack):
(_transform_name_to_obstack): Likewise.
* src/unlink.c (dunlink_alloc): Likewise.
* src/buffer.c (struct zip_magic): Use const when appropriate.
* src/incremen.c (obstack_code_rename, write_directory_file_entry):
Likewise.
* src/sparse.c (COPY_STRING): Likewise.
* src/system.c (dec_to_env, time_to_env, oct_to_env, str_to_env):
(chr_to_env): Likewise.
* src/tar.c (tar_list_quoting_style, set_stat_signal): Likewise.
* src/extract.c (extract_node): Don't return garbage.
* src/names.c: Remove old-style declarations of getgrnam etc.
All modern systems declare these, and it's not worth the hassle
of ignoring the warnings on modern systems for old-style decls.
2010-06-16 13:04:12 -07:00
Eric Blake
705fab49eb
Avoid undefined behavior
...
* src/xheader.c (xheader_set_keyword_equal): Pass correct type to
ctype macros.
* src/transform.c (run_case_conv): Likewise.
2009-05-12 12:12:15 +03:00
Sergey Poznyakoff
b4ec8aedf9
* NEWS, configure.ac: Version 1.20.91
...
* doc/tar.texi: Document transformation scope flags.
* src/common.h (transform_symlinks_option): Remove in favor of
transformation scope flags.
(XFORM_REGFILE, XFORM_LINK, XFORM_SYMLINK, XFORM_ALL): New macros.
(transform_name, transform_member_name, transform_name_fp): Take
an additional argument, specifying scope flags.
* src/create.c: Reflect changes to transform_name.
* src/extract.c (extract_link, extract_symlink): Remove calls to
transform_member_name. It is done in read_header.
* src/list.c (decode_xform): Reflect change in data type of 2nd
argument.
(transform_member_name): 2nd arg is int.
(decode_header): Transform file name and link target names.
* src/tar.c: Remove --transform-symlinks.
* src/transform.c (struct transform): New member `flags'.
(transform_flags): New variable.
(parse_transform_expr): Parse transformation scope flags. Allow to
set global flags using `flags=' syntax.
(_transform_name_to_obstack, transform_name_fp)
(transform_name): Take an additional argument, specifying scope
flags.
2008-10-30 14:13:01 +00:00
Sergey Poznyakoff
338591a486
Support multiple --transform options. Support semicolon-separated lists of replace expressions.
2008-02-04 10:35:20 +00:00
Sergey Poznyakoff
a0fb51e136
Relicense under GPLv3
2007-06-27 13:30:12 +00:00
Sergey Poznyakoff
586c684815
(transform_name_fp): Change signature. All callers updated.
2007-03-30 19:20:52 +00:00
Sergey Poznyakoff
c5b15c4ac1
(segm_count): Change type to size_t
2006-06-24 16:49:05 +00:00
Sergey Poznyakoff
5e14ef32c0
Minor fixes.
2006-06-08 22:35:52 +00:00
Sergey Poznyakoff
02c7b862a3
(add_char_segment): Fix length assignement
2006-06-08 09:50:56 +00:00
Sergey Poznyakoff
6be1349236
(set_transform_expr,_transform_name_to_obstack): Implement NUMBER flag.
2006-06-08 09:27:25 +00:00
Sergey Poznyakoff
8b2f4ad670
(_transform_name_to_obstack,set_transform_expr): Implement case conversion operations (GNU extension).
2006-06-07 14:57:10 +00:00
Sergey Poznyakoff
435edb824e
(transform_name_fp): Run fun even if _transform_name_to_obstack returns false.
2006-06-06 21:33:25 +00:00
Sergey Poznyakoff
c8aa01c80c
New file
2006-06-02 08:02:24 +00:00