mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
url decoding fixes
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8809 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
55778231da
commit
d1f0cd1ae5
@ -359,19 +359,23 @@ decode (char *enc)
|
|||||||
int ch,cl;
|
int ch,cl;
|
||||||
p++;
|
p++;
|
||||||
ch = *p - 0x30; /* ascii 0 = 0x30 */
|
ch = *p - 0x30; /* ascii 0 = 0x30 */
|
||||||
if (9 < ch) ch -= 0x11 + 10; /* uppercase A = 0x41 */
|
if (9 < ch) ch -= 0x11 - 10; /* uppercase A = 0x41 */
|
||||||
if (16 < ch) ch -= 0x20; /* lowercase a = 0x61 */
|
if (16 < ch) ch -= 0x20; /* lowercase a = 0x61 */
|
||||||
|
|
||||||
p++;
|
p++;
|
||||||
cl = *p - 0x30; /* ascii 0 = 0x30 */
|
cl = *p - 0x30; /* ascii 0 = 0x30 */
|
||||||
if (9 < cl) cl -= 0x11 + 10; /* uppercase A = 0x41 */
|
if (9 < cl) cl -= 0x11 - 10; /* uppercase A = 0x41 */
|
||||||
if (16 < cl) cl -= 0x20; /* lowercase a = 0x61 */
|
if (16 < cl) cl -= 0x20; /* lowercase a = 0x61 */
|
||||||
|
|
||||||
*w = (char) (ch<<4 | cl);
|
*w = (char) (ch<<4 | cl);
|
||||||
|
|
||||||
w++;
|
do
|
||||||
*w = 0x0; /* null-terminate in case loop terminates */
|
{
|
||||||
p = strchr (p, '%');
|
++w; ++p;
|
||||||
|
*w = *p;
|
||||||
|
if (0x0 == *p) { p = 0; break; }
|
||||||
|
if ('%' == *p) { break; }
|
||||||
|
} while (*p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -400,7 +404,7 @@ kvp_frame_add_url_encoding (KvpFrame *frame, const char *enc)
|
|||||||
kvp_frame_set_slot_nc (frame, p, kvp_value_new_string(v));
|
kvp_frame_set_slot_nc (frame, p, kvp_value_new_string(v));
|
||||||
|
|
||||||
if (!n) break; /* no next key, we are done */
|
if (!n) break; /* no next key, we are done */
|
||||||
p = n++;
|
p = ++n;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free(buff);
|
g_free(buff);
|
||||||
|
Loading…
Reference in New Issue
Block a user