summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/bbs.c26
-rw-r--r--mbbsd/edit.c32
2 files changed, 38 insertions, 20 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c
index 1d10941d..0baf6de9 100644
--- a/mbbsd/bbs.c
+++ b/mbbsd/bbs.c
@@ -856,7 +856,7 @@ do_general(int isbid)
char ctype[8][5] = {"���D", "��ij", "�Q��", "�߱o",
"����", "�Яq", "���i", "����"};
boardheader_t *bp;
- int islocal, posttype=-1;
+ int islocal, posttype=-1, edflags = 0;
ifuseanony = 0;
assert(0<=currbid-1 && currbid-1<MAX_BOARD);
@@ -970,8 +970,15 @@ do_general(int isbid)
setbnfile(genbuf, bp->brdname, "postsample", posttype);
Copy(genbuf, fpath);
}
+
+#ifdef EXP_EDIT_UPLOAD
+# ifdef GLOBAL_BBSMOVIE
+ if (strcmp(currboard, GLOBAL_BBSMOVIE) == 0)
+ edflags |= EDITFLAG_UPLOAD;
+# endif // GLOBAL_BBSMOVIE
+#endif // EXP_EDIT_UPLOAD
- aborted = vedit(fpath, YEA, &islocal);
+ aborted = vedit2(fpath, YEA, &islocal, edflags);
if (aborted == -1) {
unlink(fpath);
pressanykey();
@@ -1327,11 +1334,17 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct)
// int recordTouched = 0;
time4_t oldmt, newmt;
off_t oldsz;
+ int edflags = 0;
#ifdef EDITPOST_SMARTMERGE
char canDoSmartMerge = 1;
#endif // EDITPOST_SMARTMERGE
+#ifdef EXP_EDITPOST_TEXTONLY
+ // experimental: "text only" editing
+ edflags |= EXP_EDITPOST_TEXTONLY;
+#endif
+
assert(0<=currbid-1 && currbid-1<MAX_BOARD);
if (strcmp(bp->brdname, GLOBAL_SECURITY) == 0)
return DONOTHING;
@@ -1397,14 +1410,9 @@ edit_post(int ent, fileheader_t * fhdr, const char *direct)
#endif // EDITPOST_SMARTMERGE
-#ifdef EXP_EDITPOST_TEXTONLY
- // experimental: "text only" editing
- if (vedit2(fpath, 0, NULL, 1) == -1)
- break;
-#else
- if (vedit(fpath, 0, NULL) == -1)
+
+ if (vedit2(fpath, 0, NULL, edflags) == -1)
break;
-#endif
newmt = dasht(genbuf);
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index a5044dc5..813bda39 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -1639,7 +1639,7 @@ static void upload_file(void);
#endif // EXP_EDIT_UPLOAD
static int
-write_file(char *fpath, int saveheader, int *islocal, char *mytitle)
+write_file(char *fpath, int saveheader, int *islocal, char *mytitle, int upload)
{
struct tm *ptime;
FILE *fp = NULL;
@@ -1648,15 +1648,24 @@ write_file(char *fpath, int saveheader, int *islocal, char *mytitle)
int aborted = 0, line = 0, checksum[3], sum = 0, po = 1;
stand_title("�ɮ׳B�z");
+ move(1,0);
+
+ // common trail
+
if (currstat == SMAIL)
- msg = "[S]�x�s (A)��� (T)����D (E)�~�� (R/W/D)Ū�g�R�Ȧs�ɡH";
+ outs("[S]�x�s");
else if (local_article)
- msg = "[L]�����H�� (S)�x�s (A)��� (T)����D (E)�~�� "
- "(R/W/D)Ū�g�R�Ȧs�ɡH";
+ outs("[L]�����H�� (S)�x�s");
else
- msg = "[S]�x�s (L)�����H�� (A)��� (T)����D (E)�~�� "
- "(R/W/D)Ū�g�R�Ȧs�ɡH";
- getdata(1, 0, msg, ans, 2, LCECHO);
+ outs("[S]�x�s (L)�����H��");
+#ifdef EXP_EDIT_UPLOAD
+ if (upload)
+ outs(" (U)�W�Ǹ��");
+#endif // EXP_EDIT_UPLOAD
+
+ outs(" (A)��� (T)����D (E)�~�� (R/W/D)Ū�g�R�Ȧs��");
+
+ getdata(2, 0, "�T�w�n�x�s�ɮ׶ܡH ", ans, 2, LCECHO);
// avoid lots pots
sleep(1);
@@ -2794,7 +2803,7 @@ upload_file(void)
"�Цb�z���q�������ݽƻs�n���e��K�W�Y�i�}�l�ǰe�C\n");
do {
- // if (promptmsg)
+ if (!num_in_buf())
{
move(10, 0); clrtobot();
prints("\n\n��Ʊ�����... %u �줸�աC\n", (unsigned int)szdata);
@@ -2845,7 +2854,7 @@ upload_file(void)
/* �s��B�z�G�D�{���B��L�B�z */
int
-vedit2(char *fpath, int saveheader, int *islocal, int textOnly)
+vedit2(char *fpath, int saveheader, int *islocal, int flags)
{
char last = 0; /* the last key you press */
int ch, tmp;
@@ -2875,7 +2884,7 @@ vedit2(char *fpath, int saveheader, int *islocal, int textOnly)
curr_buf->firstline = curr_buf->lastline = alloc_line(WRAPMARGIN);
if (*fpath) {
- read_file(fpath, textOnly);
+ read_file(fpath, (flags & EDITFLAG_TEXTONLY) ? 1 : 0);
}
if (*quote_file) {
@@ -3017,7 +3026,8 @@ vedit2(char *fpath, int saveheader, int *islocal, int textOnly)
switch (ch) {
case KEY_F10:
case Ctrl('X'): /* Save and exit */
- tmp = write_file(fpath, saveheader, islocal, mytitle);
+ tmp = write_file(fpath, saveheader, islocal, mytitle,
+ (flags & EDITFLAG_UPLOAD) ? 1 : 0);
if (tmp != KEEP_EDITING) {
strlcpy(save_title, mytitle, sizeof(save_title));
save_title[STRLEN-1] = 0;