bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] [PATCH v2] Allow escaped delimiter in transform replace expr.


From: Charles McGarvey
Subject: [Bug-tar] [PATCH v2] Allow escaped delimiter in transform replace expr.
Date: Tue, 11 Aug 2015 17:14:31 -0600

Same thing, but with indentation chars to match the rest of the code.

---
 src/transform.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/transform.c b/src/transform.c
index cd9e27c..5deea75 100644
--- a/src/transform.c
+++ b/src/transform.c
@@ -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;
            }
-- 
2.5.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]