diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-04 11:23:19 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2003-07-04 11:23:19 +0800 |
commit | ef6f6ef05d4cc5b5234393f76e4f92f231778160 (patch) | |
tree | eb643857eff719e9c13961b2b23c4d0f82f8b975 | |
parent | 23fd54faa139a94e1d5ba7c548e6173affe9a836 (diff) | |
download | pttbbs-ef6f6ef05d4cc5b5234393f76e4f92f231778160.tar pttbbs-ef6f6ef05d4cc5b5234393f76e4f92f231778160.tar.gz pttbbs-ef6f6ef05d4cc5b5234393f76e4f92f231778160.tar.bz2 pttbbs-ef6f6ef05d4cc5b5234393f76e4f92f231778160.tar.lz pttbbs-ef6f6ef05d4cc5b5234393f76e4f92f231778160.tar.xz pttbbs-ef6f6ef05d4cc5b5234393f76e4f92f231778160.tar.zst pttbbs-ef6f6ef05d4cc5b5234393f76e4f92f231778160.zip |
use open/read instead cat
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@1016 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | pttbbs/util/BBSFileHeader.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pttbbs/util/BBSFileHeader.pm b/pttbbs/util/BBSFileHeader.pm index e9cf3cdd..f203f57c 100644 --- a/pttbbs/util/BBSFileHeader.pm +++ b/pttbbs/util/BBSFileHeader.pm @@ -41,7 +41,10 @@ sub FETCH } elsif( $key eq 'content' ){ my $fn = "$self->{dir}/" . $self->FETCH("$num.filename"); - return `/bin/cat $fn`; + my($c, $fh); + open $fh, "<$fn" || return ''; + $fh->read($c, (-s $fn)); + return $c; } else{ ($h{filename}, $h{recommend}, $h{owner}, $h{date}, $h{title}, |