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.
Chad Hurwitz churritz@cts.com
Chance Reschke creschke@usra.edu
Charles Fu ccwf@klab.caltech.edu
+Charles McGarvey chazmcgarvey@brokenzipper.com
Charles Lopes Charles.Lopes@infm.ulst.ac.uk
Charles M. Hannum mycroft@gnu.org
Chip Salzenberg tct!chip
Esa Karell karell@cs.helsinki.fi
Ezra Peisach epeisach@mit.edu
Fabio d'Alessi cars@civ.bio.unipd.it
+Flavio Poletti polettix@gmail.com
Frank Heckenbach frank@g-n-u.de
Frank Koenen koenfr@lidp.com
Franz-Werner Gergen gergen@edvulx.mpi-stuttgart.mpg.de
break;
default:
- /* Try to be nice */
- {
- char buf[2];
- buf[0] = '\\';
- buf[1] = *cur;
- add_literal_segment (tf, buf, buf + 2);
- }
+ if (*cur == delim)
+ add_char_segment (tf, delim);
+ else
+ {
+ char buf[2];
+ buf[0] = '\\';
+ buf[1] = *cur;
+ add_literal_segment (tf, buf, buf + 2);
+ }
cur++;
break;
}
version.at\
xform-h.at\
xform01.at\
+ xform02.at\
star/gtarfail.at\
star/gtarfail2.at\
star/multi-fail.at\
# Process this file with autom4te to create testsuite. -*- Autotest -*-
# Test suite for GNU tar.
-# Copyright 2004-2008, 2010-2015 Free Software Foundation, Inc.
+# Copyright 2004-2008, 2010-2016 Free Software Foundation, Inc.
# This file is part of GNU tar.
AT_BANNER([Transforms])
m4_include([xform-h.at])
m4_include([xform01.at])
+m4_include([xform02.at])
AT_BANNER([Exclude])
m4_include([exclude.at])
--- /dev/null
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+
+# Test suite for GNU tar.
+# Copyright 2009-2010, 2013-2016 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+AT_SETUP([transforming escaped delimiters on create])
+AT_KEYWORDS([transform xform delimiter])
+
+AT_TAR_CHECK([
+genfile --file file
+tar cvf /dev/null file \
+ --transform='s/file/other\/name/' \
+ --show-transformed-name
+],
+[0],
+[other/name
+])
+
+AT_CLEANUP
+
+# End of xform02.at