diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-25 09:12:27 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-07-25 09:12:27 +0300 |
commit | 89eca3384af875dc59f2563c33f8e35a923fbfe1 (patch) | |
tree | 40bdcc105aa8ff3b343fc3f93d44376a7f41acad /src/gmutil.c | |
parent | a81b43d33c7b37996cd04c527917c3651c5cdc65 (diff) |
Encode spaces in URLs
Diffstat (limited to 'src/gmutil.c')
-rw-r--r-- | src/gmutil.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gmutil.c b/src/gmutil.c index 07861523..ce50f015 100644 --- a/src/gmutil.c +++ b/src/gmutil.c | |||
@@ -23,3 +23,12 @@ void init_Url(iUrl *d, const iString *text) { | |||
23 | } | 23 | } |
24 | iRelease(pattern); | 24 | iRelease(pattern); |
25 | } | 25 | } |
26 | |||
27 | void urlEncodeSpaces_String(iString *d) { | ||
28 | for (;;) { | ||
29 | const size_t pos = indexOfCStr_String(d, " "); | ||
30 | if (pos == iInvalidPos) break; | ||
31 | remove_Block(&d->chars, pos, 1); | ||
32 | insertData_Block(&d->chars, pos, "%20", 3); | ||
33 | } | ||
34 | } | ||