aboutsummaryrefslogtreecommitdiff
path: root/lib/tar/urldecode.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-06-29 18:21:58 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-07-08 19:17:35 +0200
commite6a19ba1a05f77f051187a6b1a828ee6d39ce052 (patch)
treec8a1566b10883edbe4a8bc9a724461f4003aaa10 /lib/tar/urldecode.c
parent359d71e90050a8b83f7bc7d2ecd4ff29c477cc22 (diff)
Cleanup: split libtar header, move to sub directory
Some of the on-disk format internals are moved to a separate header and some of the stuff from internal.h is moved to that format header. C++ guards are added in addtion. Everything PAX related is moved to pax_header.c, some internal functions are marked as static. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/tar/urldecode.c')
-rw-r--r--lib/tar/urldecode.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/lib/tar/urldecode.c b/lib/tar/urldecode.c
deleted file mode 100644
index 6fac4d3..0000000
--- a/lib/tar/urldecode.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* SPDX-License-Identifier: GPL-3.0-or-later */
-/*
- * urldecode.c
- *
- * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
- */
-#include "config.h"
-
-#include "internal.h"
-
-static int xdigit(int x)
-{
- if (isupper(x))
- return x - 'A' + 0x0A;
- if (islower(x))
- return x - 'a' + 0x0A;
- return x - '0';
-}
-
-void urldecode(char *str)
-{
- unsigned char *out = (unsigned char *)str;
- char *in = str;
- int x;
-
- while (*in != '\0') {
- x = *(in++);
-
- if (x == '%' && isxdigit(in[0]) && isxdigit(in[1])) {
- x = xdigit(*(in++)) << 4;
- x |= xdigit(*(in++));
- }
-
- *(out++) = x;
- }
-
- *out = '\0';
-}