diff options
author | robertabcd <robertabcd@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-03-24 20:58:03 +0800 |
---|---|---|
committer | robertabcd <robertabcd@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2012-03-24 20:58:03 +0800 |
commit | 4bbeab6620841ad323ba0d02d3aeed46dd01d9d0 (patch) | |
tree | e331946bfe5f4f1af0c1b85f701f11b3128b9536 | |
parent | d55245c916c76f93076b11e4172f33c64a9ef979 (diff) | |
download | pttbbs-4bbeab6620841ad323ba0d02d3aeed46dd01d9d0.tar pttbbs-4bbeab6620841ad323ba0d02d3aeed46dd01d9d0.tar.gz pttbbs-4bbeab6620841ad323ba0d02d3aeed46dd01d9d0.tar.bz2 pttbbs-4bbeab6620841ad323ba0d02d3aeed46dd01d9d0.tar.lz pttbbs-4bbeab6620841ad323ba0d02d3aeed46dd01d9d0.tar.xz pttbbs-4bbeab6620841ad323ba0d02d3aeed46dd01d9d0.tar.zst pttbbs-4bbeab6620841ad323ba0d02d3aeed46dd01d9d0.zip |
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
-rw-r--r-- | pttbbs/util/mandex.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |