From 4bbeab6620841ad323ba0d02d3aeed46dd01d9d0 Mon Sep 17 00:00:00 2001 From: robertabcd Date: Sat, 24 Mar 2012 12:58:03 +0000 Subject: Keep filemode after rebuilding man index. Note: stamplink clears fhdr. git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5585 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- pttbbs/util/mandex.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pttbbs/util/mandex.c b/pttbbs/util/mandex.c index fd393b99..4c2d0a8a 100644 --- a/pttbbs/util/mandex.c +++ b/pttbbs/util/mandex.c @@ -80,6 +80,7 @@ man_index(const char * brdname) struct stat st; fileheader_t fhdr; const boardheader_t *bptr; + char filemode = 0; if ((i = getbnum(brdname)) == 0) return; @@ -134,6 +135,8 @@ man_index(const char * brdname) } i++; } + if (index_pos >= 0) + filemode = fhdr.filemode; p = strrchr(buf, '/'); *p = '\0'; @@ -142,6 +145,7 @@ man_index(const char * brdname) symlink(fn_index, buf); strlcpy(fhdr.owner, "每天自動更新", sizeof(fhdr.owner)); snprintf(fhdr.title, sizeof(fhdr.title), "%s (%.1fk)", index_title, st.st_size / 1024.); + fhdr.filemode = filemode; sprintf(buf, "%s.new", fpath); -- cgit v1.2.3