--- lbbs/src/article_post.c 2025/06/13 12:01:27 1.3 +++ lbbs/src/article_post.c 2025/06/13 13:39:46 1.5 @@ -54,16 +54,16 @@ int article_post(SECTION_LIST *p_section moveto(21, 1); prints("发表文章于 %s[%s] 讨论区", p_section->stitle, p_section->sname); moveto(22, 1); - prints("使用标题: %s", (title[0] == '\0' ? "[正在设定主题]" : title)); + prints("标题: %s", (title[0] == '\0' ? "[无]" : title)); moveto(23, 1); - prints("使用第 %d 个签名", sign_id); + prints("使用第 %d 个签名", sign_id); if (toupper(ch) != 'T') { - prints(" 按0~3选签名档"); + prints(" 按0~3选签名档(0表示不使用)"); moveto(24, 1); - prints("T改标题, C取消, Enter继续: "); + prints("T改标题, C取消, Enter继续: "); iflush(); ch = 0; } @@ -85,16 +85,12 @@ int article_post(SECTION_LIST *p_section ; *q = '\0'; len = q - p; - if (*p != '\0') { memcpy(title, p, (size_t)len + 1); memcpy(title_input, title, (size_t)len + 1); } - if (title[0] != '\0') // title is valid - { - ch = 0; - } + ch = 0; break; case 'C': clearscr(); @@ -115,7 +111,7 @@ int article_post(SECTION_LIST *p_section break; } - if (ch != CR) + if (ch != CR || title[0] == '\0') { continue; } @@ -154,6 +150,11 @@ int article_post(SECTION_LIST *p_section break; } } + + if (toupper(ch) != 'T') + { + break; + } } // editor_data_save(p_editor_data, p_data_new, data_new_len); @@ -180,12 +181,14 @@ int article_modify(SECTION_LIST *p_secti log_error("article_cache_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid); return -2; } + p_editor_data = editor_data_load(cache.p_data); if (p_editor_data == NULL) { log_error("editor_data_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid); return -2; } + if (article_cache_unload(&cache) < 0) { log_error("article_cache_unload(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid); @@ -195,6 +198,7 @@ int article_modify(SECTION_LIST *p_secti editor_display(p_editor_data); // editor_data_save(p_editor_data, p_data_new, data_new_len); + log_common("Debug: modify article\n"); editor_data_cleanup(p_editor_data); @@ -216,12 +220,14 @@ int article_reply(SECTION_LIST *p_sectio log_error("article_cache_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid); return -2; } + p_editor_data = editor_data_load(cache.p_data); if (p_editor_data == NULL) { log_error("editor_data_load(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid); return -2; } + if (article_cache_unload(&cache) < 0) { log_error("article_cache_unload(aid=%d, cid=%d) error\n", p_article->aid, p_article->cid); @@ -231,6 +237,7 @@ int article_reply(SECTION_LIST *p_sectio editor_display(p_editor_data); // editor_data_save(p_editor_data, p_data_new, data_new_len); + log_common("Debug: reply article\n"); editor_data_cleanup(p_editor_data);