summaryrefslogtreecommitdiff
path: root/tar/subst.c
Commit message (Collapse)AuthorAgeFilesLines
* use regfree to release the memorybanjiuqingshan2022-11-181-0/+1
| | | use regfree() to release the memory requested by the regular expression.#1804
* Initialize subst rule->result pointer to NULLGraham Percival2016-09-281-0/+1
| | | | | | | | | | | | | This is not directly useful in libarchive at the present time, but it might be in the future. If a project which uses this code adds an atexit(3) handler to clean up memory, and somebody runs: bsdtar somestring -t then "omestring" will be interpreted as an (invalid) substitution rule and call lafe_errc(). However, if the atexit() handler then calls cleanup_substition(), it will try to free(rule->result) which was not initialized. Sponsored by: Tarsnap Backup Inc.
* Apply global flag in substitutionSean Farley2016-01-031-52/+54
| | | | | | | | Add loop to move through a path name looking for additional matches if the global flag is provided for a substitution. The loop breaks when no more matches are found for the rule. Previously, the global flag would end up advancing to the next rule instead of searching farther into the path for another match.
* Support POSIX regular expression support using PCRE in CMake builds.Andres Mejia2013-01-311-2/+6
| | | | | | | This change is mainly meant for Windows regex support, where PCRE Windows development is much more active than development of the regex library found in the GNUWin32 packages. I found that the latest release of PCRE built right out of the box, unlike the GNUWin32 regex library released 6 years ago which failed to build from source for me using the mingw toolchain.
* Issue 165: Use GNU tar-style hHrRsS trailing flags toTim Kientzle2011-11-051-7/+28
| | | | | | control hardlink, regular filename, and symlink substitutions. SVN-Revision: 3748
* Extend the tar test to verify that symlink and hardlinkTim Kientzle2011-09-041-7/+13
| | | | | | | | | | targets get properly rewritten by default. Adjust the -s parser so that symlink and hardlink target rewriting is enabled by default and the 's' or 'S' flags disable both. SVN-Revision: 3676
* Fix handling of ~ within the target of a 'tar -s' directive.Colin Percival2011-08-201-1/+3
| | | | | | | | | | | | | According to the man page, "~ is substituted with the match", but prior to this commit it was substituted with the entire source string up to the end of the matching region. -s /o/_~/, prior to this commit: foo -> f_foo -s /o/_~/, after this commit: foo -> f_oo Reported by: Carlo Teubner SVN-Revision: 3643
* memcpy(new_str, NULL, 0) is _technically_ undefined behaviour under C99;Colin Percival2011-08-161-2/+4
| | | | | | | | | it's hard to imagine this actually being compiled "wrong", but avoid it anyway. Via: Tarsnap SVN-Revision: 3622
* Drop a few unnecessary arguments.Tim Kientzle2009-06-141-10/+10
| | | | SVN-Revision: 1163
* Refactor common frontend code into a separate library.Joerg Sonnenberger2009-05-261-11/+13
| | | | SVN-Revision: 1118
* Merge r354 from release/2.6: Fix multiple -s options.Tim Kientzle2009-01-041-1/+1
| | | | | | | | Add test_option_s to exercise basic -s handling. Thanks to Wayne Marshall for reporting this problem. SVN-Revision: 369
* IFCTim Kientzle2008-06-211-1/+1
| | | | SVN-Revision: 134
* IFCTim Kientzle2008-06-141-2/+2
| | | | SVN-Revision: 118
* Don't use case '1' ... '9', not ISO C.Joerg Sonnenberger2008-05-291-1/+9
| | | | SVN-Revision: 105
* IFCTim Kientzle2008-05-281-2/+2
| | | | SVN-Revision: 104
* Minor portability enhancement; define REG_BASIC if it's notTim Kientzle2008-05-281-0/+4
| | | | | | already defined. SVN-Revision: 99
* Enable the new -s substitution support on FreeBSD, includeTim Kientzle2008-05-241-1/+1
| | | | | | | the new source file, and fix a minor compiler warning in the substitution code. SVN-Revision: 91
* Add support for pax-like tar substitutions as found in NetBSD'sJoerg Sonnenberger2008-05-131-0/+275
pax-as-tar. This code is not compiled in on platforms lacking regex.h. SVN-Revision: 53