Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
in urldecode if strtol isn't able to decode the hex consider this was not urlencoded
Baptiste Daroussin committed 14 years ago
commit b16d8cc2710a265dc624d38db62561be78693f60
parent 262f2b1
1 file changed +7 -3
modified libpkg/pkg_manifest.c
@@ -126,10 +126,14 @@ urldecode(const char *src, struct sbuf **dest)
			errno = 0;
			c = strtol(hex, NULL, 16);
			if (errno != 0) {
-
				pkg_emit_errno("strtol()", hex);
-
				return (EPKG_FATAL);
+
				/* 
+
				 * if it fails consider this is not a urlencoded
+
				 * information
+
				 */
+
				sbuf_printf(*dest, "%%%s", hex);
+
			} else {
+
				sbuf_putc(*dest, c);
			}
-
			sbuf_putc(*dest, c);
		}
	}
	sbuf_finish(*dest);