From 33cd660f68857ca73061593364524b441cfe5df1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 24 Mar 2022 12:45:06 +0100 Subject: [PATCH] faster hexdecode for mixed data (e.g. post-data) --- cgilite.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cgilite.sh b/cgilite.sh index 90d6557..6cbd7ec 100755 --- a/cgilite.sh +++ b/cgilite.sh @@ -89,7 +89,8 @@ HEX_DECODE(){ "$pfx"[0-9a-fA-F][0-9a-fA-F]*) in="${in#${pfx}}";; \\*) in="${in#?}"; out="${out}\\\\"; continue;; %*) in="${in#?}"; out="${out}%%"; continue;; - *) out="${out}${in%"${in#?}"}"; in="${in#?}"; continue;; + *) att="${in%%"${pfx}"*}"; att="${att%%%*}"; att="${att%%\\*}" + out="${out}${att}"; in="${in#"${att}"}"; continue;; esac; # Hex escapes for printf (e.g. \x41) are not portable -- 2.39.2