]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions.sh: replace strstr()
authorHarald Hoyer <harald@redhat.com>
Fri, 22 Jun 2012 06:57:20 +0000 (08:57 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 29 Jun 2012 10:41:25 +0000 (12:41 +0200)
the new strstr() is faster, when compared

dracut-functions.sh

index d4a766b916ca839c6e44bf142bcb4393bdc7f3e7..ace5a0bcf0bf0195ba8583a300869ac0d6c1d7cb 100755 (executable)
@@ -21,7 +21,7 @@
 #
 
 # Generic substring function.  If $2 is in $1, return 0.
-strstr() { [ "${1#*$2*}" != "$1" ]; }
+strstr() { [[ $1 = *$2* ]]; }
 
 if ! [[ $dracutbasedir ]]; then
     dracutbasedir=${BASH_SOURCE[0]%/*}