vp

git clone git://oldgit.suckless.org/vp/
Log | Files | Refs | README

commit 701115683cc92cf8d6acd937442d9da79323d7fe
parent 808dc3969b471e8c734bdc307c9efe6df7e21a6a
Author: Kris Maglione <kris@suckless.org>
Date:   Sun, 15 Aug 2010 12:40:04 -0400

Minor simplifications.

Diffstat:
vp-base | 10++--------
vp-xhamster | 11++---------
2 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/vp-base b/vp-base @@ -74,15 +74,9 @@ if(~ $vp_base_loaded '') { vp_result = $* } + vp_urldec = 'hextab["' ^ (0 1 2 3 4 5 6 7 8 9 a b c d e f) ^ '"] = ' ^ `{seq 0 15} ^ ';' vp_urldec = ' - BEGIN { - hextab["0"] = 0; hextab["6"] = 6; hextab["c"] = 12; - hextab["1"] = 1; hextab["7"] = 7; hextab["d"] = 13; - hextab["2"] = 2; hextab["8"] = 8; hextab["e"] = 14; - hextab["3"] = 3; hextab["9"] = 9; hextab["f"] = 15; - hextab["4"] = 4; hextab["a"] = 10; - hextab["5"] = 5; hextab["b"] = 11; - } + BEGIN { '$"vp_urldec' } function urldec(str, c, i, res) { i = 1 res = "" diff --git a/vp-xhamster b/vp-xhamster @@ -4,15 +4,8 @@ . vp-base $0 $* -vp_result `{vp_data $* | awk ' +vp_result `{vp_data $* | awk -F '^ *''|'': *''|''[,\r]' ' END { print a["srv"] "/" a["type"] "2/" a["file"] } - /^[ ]*''[a-z]+'':/ { - sub(/^[ ]*''/, "") - name = $0 - sub(/''.*/, "", name) - sub(/[^:]*'' *: *''/, "") - sub(/''.*/, "") - a[name] = $0 - } + /^[ ]*''[a-z]+'':/ { a[$2] = $3 } '}