]> Dogcows Code - chaz/tar/blobdiff - src/transform.c
Allow escaped delimiter in transform replace expr.
[chaz/tar] / src / transform.c
index cf0189cc53943837c6ea3bf4a18c3278fc30b60f..5deea759873c326c557dbbf6ab84ac20109b4fb5 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of GNU tar.
-   Copyright 2006-2008, 2013 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
@@ -378,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.021833 seconds and 4 git commands to generate.