--- lbbs/src/editor.c 2025/10/11 10:36:42 1.45 +++ lbbs/src/editor.c 2025/10/16 11:26:16 1.47 @@ -83,7 +83,7 @@ EDITOR_DATA *editor_data_load(const char if (p_data == NULL) { - log_error("editor_data_load() error: NULL pointer\n"); + log_error("NULL pointer error\n"); return NULL; } @@ -150,7 +150,7 @@ long editor_data_save(const EDITOR_DATA if (p_editor_data == NULL || p_data == NULL) { - log_error("editor_data_save() error: NULL pointer\n"); + log_error("NULL pointer error\n"); return -1; } @@ -224,7 +224,7 @@ int editor_data_insert(EDITOR_DATA *p_ed if (p_editor_data == NULL || p_last_updated_line == NULL) { - log_error("editor_data_op() error: NULL pointer\n"); + log_error("NULL pointer error\n"); return -1; } @@ -462,7 +462,7 @@ int editor_data_delete(EDITOR_DATA *p_ed if (p_editor_data == NULL || p_last_updated_line == NULL) { - log_error("editor_data_op() error: NULL pointer\n"); + log_error("NULL pointer error\n"); return -1; } @@ -705,6 +705,11 @@ int editor_display(EDITOR_DATA *p_editor ch = igetch_t(MAX_DELAY_TIME); while (!SYS_server_exit) { + if (ch != KEY_NULL && ch != KEY_TIMEOUT) + { + BBS_last_access_tm = time(NULL); + } + // extended key handler if (editor_display_key_handler(&ch, &ctx) != 0) { @@ -742,8 +747,6 @@ int editor_display(EDITOR_DATA *p_editor if ((ch >= 32 && ch < 127) || str_len >= 2 || // Printable character or multi-byte character ch == CR || ch == KEY_ESC) // Special character { - BBS_last_access_tm = time(NULL); - // Refresh current action while user input if (user_online_update(NULL) < 0) { @@ -837,8 +840,6 @@ int editor_display(EDITOR_DATA *p_editor } else if (ch == KEY_DEL || ch == BACKSPACE) // Del { - BBS_last_access_tm = time(NULL); - // Refresh current action while user input if (user_online_update(NULL) < 0) { @@ -930,7 +931,10 @@ int editor_display(EDITOR_DATA *p_editor switch (ch) { case KEY_NULL: + log_error("KEY_NULL\n"); + goto cleanup; case KEY_TIMEOUT: + log_error("User input timeout\n"); goto cleanup; case Ctrl('W'): case Ctrl('X'): @@ -1134,8 +1138,6 @@ int editor_display(EDITOR_DATA *p_editor break; } - BBS_last_access_tm = time(NULL); - // Refresh current action while user input if (user_online_update(NULL) < 0) {