mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Merge bk-internal:/home/bk/mysql-4.1-maint
into neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
This commit is contained in:
@@ -13,6 +13,8 @@ sub mtr_tofile ($@);
|
||||
sub mtr_tonewfile($@);
|
||||
sub mtr_lastlinefromfile($);
|
||||
sub mtr_appendfile_to_file ($$);
|
||||
sub mtr_grab_file($);
|
||||
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -128,6 +130,7 @@ sub unspace {
|
||||
return "$quote$string$quote";
|
||||
}
|
||||
|
||||
# Read a whole file, stripping leading and trailing whitespace.
|
||||
sub mtr_fromfile ($) {
|
||||
my $file= shift;
|
||||
|
||||
@@ -181,5 +184,16 @@ sub mtr_appendfile_to_file ($$) {
|
||||
close TOFILE;
|
||||
}
|
||||
|
||||
# Read a whole file verbatim.
|
||||
sub mtr_grab_file($) {
|
||||
my $file= shift;
|
||||
open(FILE, '<', $file)
|
||||
or return undef;
|
||||
local $/= undef;
|
||||
my $data= scalar(<FILE>);
|
||||
close FILE;
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
Reference in New Issue
Block a user