Compare commits

..

No commits in common. "cb9ec6141c9c584c431cab10b489f7bd4e58dbd5" and "9136ab2565c9f33dc9972b6398deaa4699555aa3" have entirely different histories.

7 changed files with 3 additions and 45 deletions

View File

@ -1,9 +1,5 @@
# To do
- [ ] Look into improving speed and performance:
- [ ] Creating objects only once, e.g., for js strings that I execte
- [ ] Look into using global controllers, rather than one for each webview
- [ ] etc.
- [ ] Move to a later C standard (C11?) and use safer string handling functions provided by it.
- The thing is, I kinda feel attached to C89-C99
- [ ] Consider

View File

@ -68,7 +68,5 @@ int libre_redirect(const char* uri, char* output)
}
strcpy(output, uri);
}
int utm_check = str_destructively_omit_from(output, "?utm");
return utm_check * 2;
return 0;
}

View File

@ -59,26 +59,3 @@ See also:
* <https://web.archive.org/web/20160201212501/coding.debuntu.org/c-implementing-str_replace-replace-all-occurrences-substring>
* https://github.com/irl/la-cucina/blob/master/str_replace.c
*/
int str_destructively_omit_from(char* input, const char* from){
// input = "https://url.com/?utm=blah", from = "?utm"
int l1 = strlen(input);
int l2 = strlen(from);
for(int i=0; i<l1; i++){
if((i + l2) > l1) { // no more room
continue;
}
for(int j=0; j<l2; j++){
if(input[i+j] != from[j]){
goto cont;
}
}
input[i]='\0';
printf("Replaced utm %s\n", input);
return 1;
cont:;
}
return 0;
}

View File

@ -2,4 +2,3 @@
void str_init(char* str, int n);
int str_replace_start(const char* string, const char* target, const char* replacement, char* output);
int str_destructively_omit_from(const char* input, const char* from);

View File

@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define STYLE_N 9379 + 1000
#define STYLE_N 9278 + 1000
void read_style_js(char* string)
{

View File

@ -1,5 +1,5 @@
#pragma once
#define STYLE_N 9379 + 1000
#define STYLE_N 9278 + 1000
void read_style_js(char* string);

View File

@ -344,15 +344,3 @@ function filterByKeyword(str) {
}
});
}
var keywords = [
"Sinwar",
"fentanyl",
"tanker",
"Hasina",
"blame",
"victory plan",
];
for (let keyword of keywords) {
filterByKeyword(keyword);
}