summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-09-11 09:27:11 (GMT)
committer Vincent Sanders <vince@kyllikki.org>2016-09-11 09:27:11 (GMT)
commit17de8d91ac51f487a8a7fc95bd9fc5edfd2d30cc (patch)
treebbf0cad5954f9f7c9456a7c5704d6182ea04eb45
parent11d2921bbfca6c00ec1d68bdb6ddd25beacbec3d (diff)
downloadnetsurf-17de8d91ac51f487a8a7fc95bd9fc5edfd2d30cc.tar.gz
netsurf-17de8d91ac51f487a8a7fc95bd9fc5edfd2d30cc.tar.bz2
change save complete to use ascii character manipulation
-rw-r--r--desktop/save_complete.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/desktop/save_complete.c b/desktop/save_complete.c
index 314fbfc..f8f0057 100644
--- a/desktop/save_complete.c
+++ b/desktop/save_complete.c
@@ -23,7 +23,6 @@
*/
#include <assert.h>
-#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
@@ -40,6 +39,7 @@
#include "utils/utils.h"
#include "utils/file.h"
#include "utils/messages.h"
+#include "utils/ascii.h"
#include "netsurf/content.h"
#include "content/hlcache.h"
#include "css/css.h"
@@ -210,13 +210,14 @@ static char *save_complete_rewrite_stylesheet_urls(save_complete_ctx *ctx,
for (offset = 0; SLEN("@import") < size &&
offset <= size - SLEN("@import"); offset++) {
if (source[offset] == '@' &&
- tolower(source[offset + 1]) == 'i' &&
- tolower(source[offset + 2]) == 'm' &&
- tolower(source[offset + 3]) == 'p' &&
- tolower(source[offset + 4]) == 'o' &&
- tolower(source[offset + 5]) == 'r' &&
- tolower(source[offset + 6]) == 't')
+ ascii_to_lower(source[offset + 1]) == 'i' &&
+ ascii_to_lower(source[offset + 2]) == 'm' &&
+ ascii_to_lower(source[offset + 3]) == 'p' &&
+ ascii_to_lower(source[offset + 4]) == 'o' &&
+ ascii_to_lower(source[offset + 5]) == 'r' &&
+ ascii_to_lower(source[offset + 6]) == 't') {
imports++;
+ }
}
rewritten = malloc(size + imports * 20);