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
23
sub mtr_match_prefix ($$);
24
sub mtr_match_extension ($$);
25
sub mtr_match_any_exact ($$);
27
##############################################################################
31
##############################################################################
33
# Match a prefix and return what is after the prefix
35
sub mtr_match_prefix ($$) {
39
if ( $string =~ /^\Q$prefix\E(.*)$/ ) # strncmp
50
# Match extension and return the name without extension
52
sub mtr_match_extension ($$) {
56
if ( $file =~ /^(.*)\.\Q$ext\E$/ ) # strchr+strcmp or something
67
# Match a substring anywere in a string
69
sub mtr_match_substring ($$) {
73
if ( $string =~ /(.*)\Q$substring\E(.*)$/ ) # strncmp
84
sub mtr_match_any_exact ($$) {
88
foreach my $m (@$mlist)