Re-apply r5943.


git-svn-id: http://opensvn.csie.org/pttbbs/trunk@5946 63ad8ddf-47c3-0310-b6dd-a9e9d9715204