X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftransform.c;h=155d369810d967e61090654e1cefdb97cc722ee0;hb=d30babc23b4f25be970ada2e63a50220a3672281;hp=cf0189cc53943837c6ea3bf4a18c3278fc30b60f;hpb=daa269958ad8d50ef8154ccb65e58acaf7a6dd99;p=debian%2Ftar diff --git a/src/transform.c b/src/transform.c index cf0189cc..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 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; }