From d8d7b94bc47f6367498a9ec718bc98231831e1cf Mon Sep 17 00:00:00 2001 From: nuex Date: Mon, 18 Nov 2013 15:27:40 -0500 Subject: [PATCH] prevent variables from spilling out into global scope --- lib/render.awk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/render.awk b/lib/render.awk index 1e1c271..a6a375a 100644 --- a/lib/render.awk +++ b/lib/render.awk @@ -76,7 +76,7 @@ END { } } -function bind_data(txt, tag, key) { +function bind_data(txt, tag, key, partial_txt) { if (match(txt, /{{> ([^}]*)}}/)) { tag = substr(txt, RSTART, RLENGTH) match(tag, /([[:alnum:]_]|[?]).*[^}]/) @@ -102,7 +102,7 @@ function bind_data(txt, tag, key) { # line. # # Nothing is returned if the file doesn't exist. -function load_partial(key, partial, partial_file, line) { +function load_partial(key, partial, pwd, partial_file, partial_txt, line) { partial = partials[key] if (partial) { return partial @@ -128,7 +128,7 @@ function load_partial(key, partial, partial_file, line) { } # Check if a file exists -function is_file(file) { +function is_file(file, check, response) { check = "[ -f " file " ] && echo yes" check | getline response close(check)