summaryrefslogtreecommitdiffstats
path: root/src/cmds_command.c
diff options
context:
space:
mode:
authorAndrés <andmarti@gmail.com>2021-03-21 14:44:36 -0300
committerAndrés <andmarti@gmail.com>2021-03-21 14:44:36 -0300
commit132c413389e39e5f974ab26551ec8656ef02399e (patch)
tree57a7c8158036a6bbb5475da8cd0e142736f1142b /src/cmds_command.c
parent8bf1bc290a850080b1f1505951c01409760d8f98 (diff)
fix issue setting conf variables like nonumeric
Diffstat (limited to 'src/cmds_command.c')
-rw-r--r--src/cmds_command.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/cmds_command.c b/src/cmds_command.c
index 6bfa858..3f39000 100644
--- a/src/cmds_command.c
+++ b/src/cmds_command.c
@@ -792,25 +792,30 @@ void do_commandmode(struct block * sb) {
}
swprintf(interp_line + wcslen(interp_line), BUFFERSIZE, L"%ls", line);
send_to_interp(interp_line);
+
} else if ( ! wcsncmp(inputline, L"untrigger ", 10) ) {
wcscpy(interp_line, inputline);
send_to_interp(interp_line);
- } else if ( ! wcsncmp(inputline, L"set ", 4) ) {
+ } else if ( ! wcsncmp(inputline, L"set ", 4) ) {
wchar_t line [BUFFERSIZE];
wcscpy(line, inputline);
del_range_wchars(line, 0, 3);
+
wchar_t * l;
char oper[BUFFERSIZE];
if ((l = wcschr(line, L' ')) != NULL) l[0] = L'\0';
if ((l = wcschr(line, L'=')) != NULL) l[0] = L'\0';
+
+ wcscpy(interp_line, inputline);
+ send_to_interp(interp_line);
+
wcstombs(oper, line, BUFFERSIZE);
if (get_conf_value(oper)) {
sc_info("Config value changed: %s", oper);
- wcscpy(interp_line, inputline);
- send_to_interp(interp_line);
- } else
- sc_error("Invalid configuration parameter");
+ } else if (strlen(oper) > 2 && ! wcsncmp(inputline, L"set no", 6)) {
+ sc_info("Config value changed: %s", &oper[2]);
+ }
} else if ( ! wcsncmp(inputline, L"pad ", 4) ) {
int c = curcol, cf = curcol;