mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-12-26 01:03:37 +00:00
If the user style.css does not exist, return the server-wide version.
This commit is contained in:
parent
7a0efc3680
commit
b2598ca307
1 changed files with 13 additions and 1 deletions
14
html.c
14
html.c
|
@ -225,7 +225,19 @@ d_char *html_user_header(snac *snac, d_char *s, int local)
|
|||
xs *css = NULL;
|
||||
int size;
|
||||
|
||||
if (valid_status(static_get(snac, "style.css", &css, &size))) {
|
||||
/* try to open the user css */
|
||||
if (!valid_status(static_get(snac, "style.css", &css, &size))) {
|
||||
/* it's not there; try to open the server-wide css */
|
||||
FILE *f;
|
||||
xs *g_css_fn = xs_fmt("%s/style.css", srv_basedir);
|
||||
|
||||
if ((f = fopen(g_css_fn, "r")) != NULL) {
|
||||
css = xs_readall(f);
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
|
||||
if (css != NULL) {
|
||||
xs *s1 = xs_fmt("<style>%s</style>\n", css);
|
||||
s = xs_str_cat(s, s1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue