zshrc: Fixing a bug in urlencode() v0.3.61
authorFrank Terbeck <ft@bewatermyfriend.org>
Fri, 5 Dec 2008 17:51:16 +0000 (18:51 +0100)
committerFrank Terbeck <ft@bewatermyfriend.org>
Fri, 5 Dec 2008 17:51:16 +0000 (18:51 +0100)
Apparently, the hex value of an encoded character must be at least 2
digits wide.

Found, explained and fix provided by Baptiste Daroussin. Thanks!

debian/changelog
etc/skel/.zshrc

index 0fa42c8..1f77374 100644 (file)
@@ -1,3 +1,10 @@
+grml-etc-core (0.3.61) unstable; urgency=low
+
+  * zshrc: Fix a bug in urlencode(), thanks to Baptiste Daroussin
+    [Closes: issue583]
+
+ -- Frank Terbeck <ft@grml.org>  Fri, 05 Dec 2008 18:48:45 +0100
+
 grml-etc-core (0.3.60) unstable; urgency=low
 
   * zshrc: add alias http for running "python -m SimpleHTTPServer"
index 377b7cf..d7b2840 100644 (file)
@@ -819,7 +819,7 @@ ogg2mp3_192() {
 urlencode() {
     setopt localoptions extendedglob
     input=( ${(s::)1} )
-    print ${(j::)input/(#b)([^A-Za-z0-9_.!~*\'\(\)-])/%$(([##16]#match))}
+    print ${(j::)input/(#b)([^A-Za-z0-9_.!~*\'\(\)-])/%${(l:2::0:)$(([##16]#match))}}
 }
 
 #f5# Install x-lite (VoIP software)