From 27df78f1e497a4428533a12aba3fb08d981a06a4 Mon Sep 17 00:00:00 2001 From: piaip Date: Tue, 22 Jan 2008 13:28:28 +0000 Subject: - stuff: fix show_file auto wrapped for file with length=80 - announce: change announce re-edit to work like board re-editing post - use same file. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3853 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/announce.c | 9 ++++----- mbbsd/pfterm.c | 1 + mbbsd/stuff.c | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'mbbsd') diff --git a/mbbsd/announce.c b/mbbsd/announce.c index 0f4aecd6..7a10ef8c 100644 --- a/mbbsd/announce.c +++ b/mbbsd/announce.c @@ -1146,20 +1146,19 @@ a_menu(const char *maintitle, const char *path, if (vedit2(fname, NA, NULL, edflags) != -1) { char fpath[PATHLEN]; fileheader_t fhdr; - strlcpy(fpath, path, sizeof(fpath)); stampfile(fpath, &fhdr); unlink(fpath); - Rename(fname, fpath); - strlcpy(me.header[me.now - me.page].filename, - fhdr.filename, - sizeof(me.header[me.now - me.page].filename)); + strlcpy(fhdr.filename, + me.header[me.now - me.page].filename, + sizeof(fhdr.filename)); strlcpy(me.header[me.now - me.page].owner, cuser.userid, sizeof(me.header[me.now - me.page].owner)); setadir(fpath, path); substitute_record(fpath, me.header + me.now - me.page, sizeof(fhdr), me.now + 1); + } me.page = 9999; } diff --git a/mbbsd/pfterm.c b/mbbsd/pfterm.c index ea1348e3..2e4f7470 100644 --- a/mbbsd/pfterm.c +++ b/mbbsd/pfterm.c @@ -112,6 +112,7 @@ // - inansistr to output escaped string [done] // - handle incomplete DBCS characters [done] // - optimization with reprint ability [done] +// - add auto wrap control // // DEPRECATED: // - standout() [rework getdata() and namecomplete()] diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c index 95030ce6..9c0be5ed 100644 --- a/mbbsd/stuff.c +++ b/mbbsd/stuff.c @@ -414,7 +414,10 @@ show_file(const char *filename, int y, int lines, int mode) clrtoln(lines + y); if ((fp = fopen(filename, "r"))) { while (fgets(buf, sizeof(buf), fp) && lines--) + { + move(y++, 0); outs(Ptt_prints(buf, sizeof(buf), mode)); + } fclose(fp); outs(ANSI_RESET); // prevent some broken Welcome file } else -- cgit v1.2.3