projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d383bc5
)
Don't bother reading this commit.
author
Art Cancro
<ajc@citadel.org>
Wed, 24 Jan 2024 01:22:33 +0000
(15:22 -1000)
committer
Art Cancro
<ajc@citadel.org>
Wed, 24 Jan 2024 01:22:33 +0000
(15:22 -1000)
webcit-ng/server/html2html.c
patch
|
blob
|
history
diff --git
a/webcit-ng/server/html2html.c
b/webcit-ng/server/html2html.c
index f04ddef7f7eda0acd237b572668990853b5e058d..506a70de7fe1b538b800f5b3b2270fe8ad9a8bf4 100644
(file)
--- a/
webcit-ng/server/html2html.c
+++ b/
webcit-ng/server/html2html.c
@@
-13,12
+13,14
@@
void stripquotes(char *s) {
int len;
void stripquotes(char *s) {
int len;
- if (!s)
+ if (!s)
{
return;
return;
+ }
len = strlen(s);
len = strlen(s);
- if (len < 2)
+ if (len < 2)
{
return;
return;
+ }
if (((s[0] == '\"') && (s[len - 1] == '\"')) || ((s[0] == '\'') && (s[len - 1] == '\''))) {
s[len - 1] = 0;
if (((s[0] == '\"') && (s[len - 1] == '\"')) || ((s[0] == '\'') && (s[len - 1] == '\''))) {
s[len - 1] = 0;
@@
-36,19
+38,24
@@
void extract_charset_from_meta(char *charset, char *meta_http_equiv, char *meta_
char *ptr;
char buf[64];
char *ptr;
char buf[64];
- if (!charset)
+ if (!charset)
{
return;
return;
- if (!meta_http_equiv)
+ }
+ if (!meta_http_equiv) {
return;
return;
- if (!meta_content)
+ }
+ if (!meta_content) {
return;
return;
+ }
- if (strcasecmp(meta_http_equiv, "Content-type"))
+ if (strcasecmp(meta_http_equiv, "Content-type"))
{
return;
return;
+ }
ptr = strchr(meta_content, ';');
ptr = strchr(meta_content, ';');
- if (!ptr)
+ if (!ptr)
{
return;
return;
+ }
safestrncpy(buf, ++ptr, sizeof buf);
string_trim(buf);
safestrncpy(buf, ++ptr, sizeof buf);
string_trim(buf);
@@
-65,8
+72,9
@@
void extract_charset_from_meta(char *charset, char *meta_http_equiv, char *meta_
}
// Remove wandering punctuation
}
// Remove wandering punctuation
- if ((ptr = strchr(charset, '\"')))
+ if ((ptr = strchr(charset, '\"')))
{
*ptr = 0;
*ptr = 0;
+ }
string_trim(charset);
}
}
string_trim(charset);
}
}