mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 19:50:26 +03:00
Use xs_replace_i() in some places.
This commit is contained in:
parent
c41f982eea
commit
48a50770f4
5
html.c
5
html.c
@ -63,10 +63,7 @@ d_char *not_really_markdown(char *content, d_char **f_content)
|
||||
s = xs_str_cat(s, "</pre>");
|
||||
|
||||
/* some beauty fixes */
|
||||
if (xs_str_in(s, "</blockquote><br>") != -1) {
|
||||
xs *os = s;
|
||||
s = xs_replace(os, "</blockquote><br>", "</blockquote>");
|
||||
}
|
||||
s = xs_replace_i(s, "</blockquote><br>", "</blockquote>");
|
||||
|
||||
*f_content = s;
|
||||
|
||||
|
3
httpd.c
3
httpd.c
@ -47,7 +47,6 @@ int server_get_handler(d_char *req, char *q_path,
|
||||
xs *list = user_list();
|
||||
char *p, *uid;
|
||||
xs *ul = xs_str_new("<ul class=\"snac-user-list\">\n");
|
||||
xs *os = s;
|
||||
|
||||
p = list;
|
||||
while (xs_list_iter(&p, &uid)) {
|
||||
@ -67,7 +66,7 @@ int server_get_handler(d_char *req, char *q_path,
|
||||
|
||||
ul = xs_str_cat(ul, "</ul>\n");
|
||||
|
||||
s = xs_replace(os, "%userlist%", ul);
|
||||
s = xs_replace_i(s, "%userlist%", ul);
|
||||
}
|
||||
|
||||
*body = s;
|
||||
|
6
snac.c
6
snac.c
@ -77,8 +77,7 @@ void srv_debug(int level, d_char *str)
|
||||
|
||||
if (xs_str_in(msg, srv_basedir) != -1) {
|
||||
/* replace basedir with ~ */
|
||||
xs *o_str = msg;
|
||||
msg = xs_replace(o_str, srv_basedir, "~");
|
||||
msg = xs_replace_i(msg, srv_basedir, "~");
|
||||
}
|
||||
|
||||
if (dbglevel >= level) {
|
||||
@ -96,8 +95,7 @@ void snac_debug(snac *snac, int level, d_char *str)
|
||||
|
||||
if (xs_str_in(msg, snac->basedir) != -1) {
|
||||
/* replace long basedir references with ~ */
|
||||
xs *o_str = msg;
|
||||
msg = xs_replace(o_str, snac->basedir, "~");
|
||||
msg = xs_replace_i(msg, snac->basedir, "~");
|
||||
}
|
||||
|
||||
srv_debug(level, msg);
|
||||
|
Loading…
Reference in New Issue
Block a user