[Vimprobable-users] [PATCH 3/3] Set setting values also for booleans
Vimprobable is a lean web browser optimised for full keyboard control
Brought to you by:
hanness
|
From: Raphael N. <rne...@hs...> - 2012-07-18 19:19:21
|
For boolean settings the var field is always null. So we set it to on or
off respectively, so it can be displayed probably.
---
main.c | 5 ++++-
1 Datei geändert, 4 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)
diff --git a/main.c b/main.c
index 56d3dc1..0fdc845 100644
--- a/main.c
+++ b/main.c
@@ -1910,8 +1910,10 @@ process_set_line(char *line) {
if (browsersettings[i].type == SettingBool) {
if (strncmp(my_pair.value, "on", 2) == 0 || strncmp(my_pair.value, "true", 4) == 0 || strncmp(my_pair.value, "ON", 2) == 0 || strncmp(my_pair.value, "TRUE", 4) == 0) {
boolval = TRUE;
+ browsersettings[i].var = "on";
} else if (strncmp(my_pair.value, "off", 3) == 0 || strncmp(my_pair.value, "false", 5) == 0 || strncmp(my_pair.value, "OFF", 3) == 0 || strncmp(my_pair.value, "FALSE", 5) == 0) {
boolval = FALSE;
+ browsersettings[i].var = "off";
} else {
return FALSE;
}
@@ -1921,7 +1923,8 @@ process_set_line(char *line) {
return FALSE;
}
}
- if (browsersettings[i].var != NULL) {
+ else if (browsersettings[i].type == SettingString ||
+ browsersettings[i].type == SettingColourval) {
strncpy(browsersettings[i].var, my_pair.value, MAX_SETTING_SIZE);
if (strlen(my_pair.value) > MAX_SETTING_SIZE - 1) {
/* in this case, \0 will not have been copied */
--
1.7.11.2
|