Blame 0065-dracut-functions.sh-replace-strstr.patch
|
Harald Hoyer |
53e990 |
From bc616b4d5660d8d79465202bdc3a1b43b4ea3ba1 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
53e990 |
From: Harald Hoyer <harald@redhat.com>
|
|
Harald Hoyer |
53e990 |
Date: Fri, 22 Jun 2012 08:57:20 +0200
|
|
Harald Hoyer |
53e990 |
Subject: [PATCH] dracut-functions.sh: replace strstr()
|
|
Harald Hoyer |
53e990 |
|
|
Harald Hoyer |
53e990 |
the new strstr() is faster, when compared
|
|
Harald Hoyer |
53e990 |
---
|
|
Harald Hoyer |
53e990 |
dracut-functions.sh | 2 +-
|
|
Harald Hoyer |
53e990 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Harald Hoyer |
53e990 |
|
|
Harald Hoyer |
53e990 |
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
|
Harald Hoyer |
53e990 |
index d4a766b..ace5a0b 100755
|
|
Harald Hoyer |
53e990 |
--- a/dracut-functions.sh
|
|
Harald Hoyer |
53e990 |
+++ b/dracut-functions.sh
|
|
Harald Hoyer |
53e990 |
@@ -21,7 +21,7 @@
|
|
Harald Hoyer |
53e990 |
#
|
|
Harald Hoyer |
53e990 |
|
|
Harald Hoyer |
53e990 |
# Generic substring function. If $2 is in $1, return 0.
|
|
Harald Hoyer |
53e990 |
-strstr() { [ "${1#*$2*}" != "$1" ]; }
|
|
Harald Hoyer |
53e990 |
+strstr() { [[ $1 = *$2* ]]; }
|
|
Harald Hoyer |
53e990 |
|
|
Harald Hoyer |
53e990 |
if ! [[ $dracutbasedir ]]; then
|
|
Harald Hoyer |
53e990 |
dracutbasedir=${BASH_SOURCE[0]%/*}
|