| 6 |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
|
#ifdef HAVE_CONFIG_H |
| 10 |
|
#include "config.h" |
| 11 |
|
#endif |
| 12 |
|
|
| 13 |
#include "bbs.h" |
#include "bbs.h" |
| 14 |
#include "common.h" |
#include "common.h" |
| 15 |
#include "editor.h" |
#include "editor.h" |
| 272 |
{ |
{ |
| 273 |
if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES) |
if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES) |
| 274 |
{ |
{ |
| 275 |
#ifdef _DEBUG |
log_debug("Split line error, display_line_total(%ld) reach limit(%d)\n", |
|
log_error("Split line error, display_line_total(%ld) reach limit(%d)\n", |
|
| 276 |
p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES); |
p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES); |
|
#endif |
|
| 277 |
|
|
| 278 |
return -2; |
return -2; |
| 279 |
} |
} |
| 367 |
// Insert blank display line after last_display_line |
// Insert blank display line after last_display_line |
| 368 |
if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES) |
if (p_editor_data->display_line_total >= MAX_EDITOR_DATA_LINES) |
| 369 |
{ |
{ |
| 370 |
#ifdef _DEBUG |
log_debug("display_line_total over limit %d >= %d\n", p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES); |
|
log_error("display_line_total over limit %d >= %d\n", p_editor_data->display_line_total, MAX_EDITOR_DATA_LINES); |
|
|
#endif |
|
| 371 |
|
|
| 372 |
// Terminate prior display line with \n, to avoid error on cleanup |
// Terminate prior display line with \n, to avoid error on cleanup |
| 373 |
if (display_line + i - 1 >= 0 && p_editor_data->display_line_lengths[display_line + i - 1] > 0) |
if (display_line + i - 1 >= 0 && p_editor_data->display_line_lengths[display_line + i - 1] > 0) |
| 759 |
ch = igetch(100); // 0.1 second |
ch = igetch(100); // 0.1 second |
| 760 |
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input |
if (ch == KEY_NULL || ch == KEY_TIMEOUT) // Ignore received bytes if no futher input |
| 761 |
{ |
{ |
| 762 |
#ifdef _DEBUG |
log_debug("Ignore %d bytes of incomplete UTF8 character\n", str_len); |
|
log_error("Ignore %d bytes of incomplete UTF8 character\n", str_len); |
|
|
#endif |
|
| 763 |
str_len = 0; |
str_len = 0; |
| 764 |
break; |
break; |
| 765 |
} |
} |
| 968 |
switch (ch) |
switch (ch) |
| 969 |
{ |
{ |
| 970 |
case KEY_NULL: |
case KEY_NULL: |
| 971 |
log_error("KEY_NULL\n"); |
log_debug("KEY_NULL\n"); |
| 972 |
goto cleanup; |
goto cleanup; |
| 973 |
case KEY_TIMEOUT: |
case KEY_TIMEOUT: |
| 974 |
log_error("User input timeout\n"); |
log_debug("User input timeout\n"); |
| 975 |
goto cleanup; |
goto cleanup; |
| 976 |
case Ctrl('W'): |
case Ctrl('W'): |
| 977 |
case Ctrl('X'): |
case Ctrl('X'): |