]> Dogcows Code - chaz/tar/blobdiff - src/transform.c
Allow escaped delimiter in transform replace expr.
[chaz/tar] / src / transform.c
index e268312cfc61000eb11258af4f35b2357b0a972e..5deea759873c326c557dbbf6ab84ac20109b4fb5 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of GNU tar.
-   Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright 2006-2008, 2013-2014 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
@@ -12,8 +12,7 @@
    Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, write to the Free Software Foundation, Inc.,
-   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <system.h>
 #include <regex.h>
@@ -379,13 +378,19 @@ parse_transform_expr (const char *expr)
              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);
+                 cur++;
+               }
+             else
+               {
+                 /* Try to be nice */
+                 char buf[2];
+                 buf[0] = '\\';
+                 buf[1] = *cur;
+                 add_literal_segment (tf, buf, buf + 2);
+               }
              cur++;
              break;
            }
This page took 0.027286 seconds and 4 git commands to generate.