~ecs/public-inbox

shorten escape v1 PROPOSED

Evan Johnston: 1
 shorten escape

 1 files changed, 1 insertions(+), 4 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.d2evs.net/~ecs/public-inbox/patches/16/mbox | git am -3
Learn more about email & git

[PATCH] shorten escape Export this patch

---
 bin/urlfilter | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/bin/urlfilter b/bin/urlfilter
index 2ba145b..46ff9af 100755
--- a/bin/urlfilter
@@ -11,10 +11,7 @@ function escape(str, c, len, res) {
	res = ""
	for (i = 1; i <= len; i++) {
		c = substr(str, i, 1);
		if (c ~ /[0-9A-Za-z]/)
			res = res c
		else
			res = res "%" sprintf("%02X", ord[c])
		res = res (c ~ /[0-9A-Za-z]/ ? c :  "%" sprintf("%02X", ord[c]))
	}
	return res
}
-- 
2.37.1