Count backslash - CHAR in node->len
authorAlan T. DeKok <aland@freeradius.org>
Wed, 9 Sep 2015 17:40:31 +0000 (13:40 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 9 Sep 2015 17:40:31 +0000 (13:40 -0400)
src/main/xlat.c
src/tests/unit/xlat.txt

index c077e3d..0f66897 100644 (file)
@@ -1400,7 +1400,9 @@ static ssize_t xlat_tokenize_literal(TALLOC_CTX *ctx, char *fmt, xlat_exp_t **he
                                *error = "Invalid escape at end of string";
                                return -(p - fmt);
                        }
+
                        p += 2;
+                       node->len += 2;
                        continue;
                }
 
@@ -2469,6 +2471,7 @@ static ssize_t xlat_expand_struct(char **out, size_t outlen, REQUEST *request, x
        }
 
        len = strlen(buff);
+
        /*
         *      If out doesn't point to an existing buffer
         *      copy the pointer to our buffer over.
index 8306b9b..8b0bf5e 100644 (file)
@@ -128,3 +128,10 @@ data /([A-Z0-9\-]*)_%{Calling-Station-Id}/
 
 xlat %{length:1 + 2
 data ERROR offset 14 'Missing closing brace at end of string'
+
+xlat "%t\tfoo"
+data "%t\tfoo"
+
+xlat "%t\t%{Client-IP-Address}"
+data "%t\t%{Client-IP-Address}"
+