MCPcopy Create free account
hub / github.com/ValveSoftware/Proton / url_unescape

Function url_unescape

lsteamclient/unixlib.cpp:931–950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

929}
930
931static void url_unescape( WCHAR *s )
932{
933 unsigned int i, len;
934 unsigned char c, d1, d2;
935
936 len = wcslen( s );
937 if (len < 3) return;
938 for (i = 0; i < len - 3; ++i)
939 {
940 if (s[i] != '%') continue;
941 if ((d1 = hexdigit( s[i + 1] )) == 0xff || (d2 = hexdigit( s[i + 2] )) == 0xff)
942 {
943 ERR( "Invalid escape %s.\n", debugstr_wn( s, 3 ) );
944 continue;
945 }
946 s[i] = d1 * 0x10 + d2;
947 len -= 2;
948 memmove( &s[i + 1], &s[i + 3], (len - i) * sizeof(*s) );
949 }
950}
951
952char *steamclient_dos_to_unix_path( const char *src, int is_url )
953{

Callers 1

Calls 1

hexdigitFunction · 0.85

Tested by

no test coverage detected