2
# Copyright (C) 2004-2006 MySQL AB
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; version 2 of the License.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
# This is a library file used by the Perl version of mysql-test-run,
18
# and is part of the translation of the Bourne shell script with the
24
use base qw(Exporter);
25
our @EXPORT= qw(mtr_match_prefix
30
# Match a prefix and return what is after the prefix
32
sub mtr_match_prefix ($$) {
36
if ( $string =~ /^\Q$prefix\E(.*)$/ ) # strncmp
48
# Match extension and return the name without extension
50
sub mtr_match_extension ($$) {
54
if ( $file =~ /^(.*)\.\Q$ext\E$/ ) # strchr+strcmp or something
66
# Match a substring anywere in a string
68
sub mtr_match_substring ($$) {
72
if ( $string =~ /(.*)\Q$substring\E(.*)$/ ) # strncmp
83
sub mtr_match_any_exact ($$) {
87
foreach my $m (@$mlist)