diff options
| author | 2023-05-02 06:49:00 +0200 | |
|---|---|---|
| committer | 2023-05-02 06:49:00 +0200 | |
| commit | be5f08e6c3d605fb2beb1fdd1c2f10818b1e1812 (patch) | |
| tree | b2d269df739a5283d3489f1996065a57a16a4edc /webfinger.c | |
| parent | Backport from xs. (diff) | |
| download | penes-snac2-be5f08e6c3d605fb2beb1fdd1c2f10818b1e1812.tar.gz penes-snac2-be5f08e6c3d605fb2beb1fdd1c2f10818b1e1812.tar.xz penes-snac2-be5f08e6c3d605fb2beb1fdd1c2f10818b1e1812.zip | |
Use xs_replace_n() where it suits.
Diffstat (limited to '')
| -rw-r--r-- | webfinger.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/webfinger.c b/webfinger.c index eb6b2ad..f56b6f2 100644 --- a/webfinger.c +++ b/webfinger.c | |||
| @@ -21,7 +21,7 @@ int webfinger_request(const char *qs, char **actor, char **user) | |||
| 21 | 21 | ||
| 22 | if (xs_startswith(qs, "https:/" "/")) { | 22 | if (xs_startswith(qs, "https:/" "/")) { |
| 23 | /* actor query: pick the host */ | 23 | /* actor query: pick the host */ |
| 24 | xs *s = xs_replace(qs, "https:/" "/", ""); | 24 | xs *s = xs_replace_n(qs, "https:/" "/", "", 1); |
| 25 | 25 | ||
| 26 | l = xs_split_n(s, "/", 1); | 26 | l = xs_split_n(s, "/", 1); |
| 27 | 27 | ||
| @@ -74,7 +74,7 @@ int webfinger_request(const char *qs, char **actor, char **user) | |||
| 74 | char *subject = xs_dict_get(obj, "subject"); | 74 | char *subject = xs_dict_get(obj, "subject"); |
| 75 | 75 | ||
| 76 | if (subject) | 76 | if (subject) |
| 77 | *user = xs_replace(subject, "acct:", ""); | 77 | *user = xs_replace_n(subject, "acct:", "", 1); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | if (actor != NULL) { | 80 | if (actor != NULL) { |
| @@ -136,7 +136,7 @@ int webfinger_get_handler(d_char *req, char *q_path, | |||
| 136 | else | 136 | else |
| 137 | if (xs_startswith(resource, "acct:")) { | 137 | if (xs_startswith(resource, "acct:")) { |
| 138 | /* it's an account name */ | 138 | /* it's an account name */ |
| 139 | xs *an = xs_replace(resource, "acct:", ""); | 139 | xs *an = xs_replace_n(resource, "acct:", "", 1); |
| 140 | xs *l = NULL; | 140 | xs *l = NULL; |
| 141 | 141 | ||
| 142 | /* strip a possible leading @ */ | 142 | /* strip a possible leading @ */ |