diff options
author | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-01-30 19:56:48 +0800 |
---|---|---|
committer | ptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-01-30 19:56:48 +0800 |
commit | b00ea38f9da4a419693ae4b98896dd9f6867060e (patch) | |
tree | 4016b9440e49677a7b773dbcb7f5efb20588f29a | |
parent | 81373ea5b1b5bcfb57ddf0b8bcb310be5b40e7eb (diff) | |
download | pttbbs-b00ea38f9da4a419693ae4b98896dd9f6867060e.tar pttbbs-b00ea38f9da4a419693ae4b98896dd9f6867060e.tar.gz pttbbs-b00ea38f9da4a419693ae4b98896dd9f6867060e.tar.bz2 pttbbs-b00ea38f9da4a419693ae4b98896dd9f6867060e.tar.lz pttbbs-b00ea38f9da4a419693ae4b98896dd9f6867060e.tar.xz pttbbs-b00ea38f9da4a419693ae4b98896dd9f6867060e.tar.zst pttbbs-b00ea38f9da4a419693ae4b98896dd9f6867060e.zip |
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1487 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/bbs.c | 30 | ||||
-rw-r--r-- | mbbsd/kaede.c | 2 |
2 files changed, 15 insertions, 17 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index f52445f2..2dc1d08d 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -429,34 +429,29 @@ static time_t last_post_time = 0; static time_t water_counts = 0; #endif -void -do_allpost(fileheader_t *postfile, const char *fpath, const char *owner) +void +do_crosspost(char *brd, fileheader_t *postfile, const char *fpath, const char *owner) { char genbuf[200]; - setbpath(genbuf, ALLPOST); + setbpath(genbuf, brd); stampfile(genbuf, postfile); unlink(genbuf); - /* jochang: boards may spread across many disk */ - /* - * link doesn't work across device, Link doesn't work if we have - * same-time-across-device posts, we try symlink now - */ - { - /* we need absolute path for symlink */ - char abspath[256] = BBSHOME "/"; - strcat(abspath, fpath); - symlink(abspath, genbuf); - } + Link(fpath, genbuf); strlcpy(postfile->owner, owner, sizeof(postfile->owner)); strlcpy(postfile->title, save_title, sizeof(postfile->title)); postfile->filemode = FILE_LOCAL; - setbdir(genbuf, ALLPOST); + setbdir(genbuf, brd); if (append_record(genbuf, postfile, sizeof(fileheader_t)) != -1) { - setbtotal(getbnum(ALLPOST)); + setbtotal(getbnum(brd)); } } +void +do_allpost(fileheader_t *postfile, const char *fpath, const char *owner) +{ + do_crosspost(ALLPOST, postfile, fpath, owner); +} static void setupbidinfo(bid_t *bidinfo) { @@ -2309,6 +2304,9 @@ good_post(int ent, fileheader_t * fhdr, char *direct) Link(genbuf2, genbuf); strcpy(ptr, fn_mandex); append_record(buf, &digest, sizeof(digest)); + getdata(1, 40, "好文值得出版到Ptt文摘?(y/N)", genbuf2, 3, LCECHO); + if(genbuf2[0]=='y') + do_crosspost("PttDigest", &digest, genbuf, digest.owner); fhdr->filemode = (fhdr->filemode & ~FILE_MARKED) | FILE_DIGEST; if (!strcmp(currboard, "Note") || !strcmp(currboard, "PttBug") || diff --git a/mbbsd/kaede.c b/mbbsd/kaede.c index a5008b10..4b6133ba 100644 --- a/mbbsd/kaede.c +++ b/mbbsd/kaede.c @@ -103,7 +103,7 @@ Link(char *src, char *dst) if (symlink(dst, src) == 0) return 0; - snprintf(cmd, sizeof(cmd), "/bin/cp -R %s %s", src, dst); + Copy(src, dst); return system(cmd); } |