summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-22 21:28:28 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-01-22 21:28:28 +0800
commit27df78f1e497a4428533a12aba3fb08d981a06a4 (patch)
treece2de5a0455d5767eba5b3930e6530b733968ac0
parent72804a46e573272fbbea6fb61cc146ddb98ef0c2 (diff)
downloadpttbbs-27df78f1e497a4428533a12aba3fb08d981a06a4.tar
pttbbs-27df78f1e497a4428533a12aba3fb08d981a06a4.tar.gz
pttbbs-27df78f1e497a4428533a12aba3fb08d981a06a4.tar.bz2
pttbbs-27df78f1e497a4428533a12aba3fb08d981a06a4.tar.lz
pttbbs-27df78f1e497a4428533a12aba3fb08d981a06a4.tar.xz
pttbbs-27df78f1e497a4428533a12aba3fb08d981a06a4.tar.zst
pttbbs-27df78f1e497a4428533a12aba3fb08d981a06a4.zip
- 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
-rw-r--r--mbbsd/announce.c9
-rw-r--r--mbbsd/pfterm.c1
-rw-r--r--mbbsd/stuff.c3
3 files changed, 8 insertions, 5 deletions
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