X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftransform.c;h=155d369810d967e61090654e1cefdb97cc722ee0;hb=d30babc23b4f25be970ada2e63a50220a3672281;hp=cd9e27ccf4f6fe624d9f401a58ffd4304bc9794b;hpb=4aa85f09e755fc827cd5ab6225f20c83cd42245d;p=debian%2Ftar diff --git a/src/transform.c b/src/transform.c index cd9e27cc..155d3698 100644 --- a/src/transform.c +++ b/src/transform.c @@ -1,5 +1,5 @@ /* This file is part of GNU tar. - Copyright 2006-2008, 2013-2014 Free Software Foundation, Inc. + Copyright 2006-2008, 2013-2014, 2016 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,15 @@ 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); + else + { + char buf[2]; + buf[0] = '\\'; + buf[1] = *cur; + add_literal_segment (tf, buf, buf + 2); + } cur++; break; }