projects
/
platform
/
upstream
/
dracut.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
76f5fa5
)
str_replace() fix
author
Michal Soltys
<soltys@ziu.info>
Thu, 15 Sep 2011 06:45:57 +0000
(08:45 +0200)
committer
Harald Hoyer
<harald@redhat.com>
Thu, 22 Sep 2011 13:46:11 +0000
(15:46 +0200)
Whitespace removal in:
out="${out}${chop# }$r"
will damage certain strings, for example the following call:
str_replace ' aax aaxaa' x y
would return 'aayaayaa' instead of ' aay aayaa'.
Signed-off-by: Michal Soltys <soltys@ziu.info>
modules.d/99base/dracut-lib.sh
patch
|
blob
|
history
diff --git
a/modules.d/99base/dracut-lib.sh
b/modules.d/99base/dracut-lib.sh
index
50b1ed2
..
62c3bf5
100755
(executable)
--- a/
modules.d/99base/dracut-lib.sh
+++ b/
modules.d/99base/dracut-lib.sh
@@
-24,7
+24,7
@@
str_replace() {
while strstr "${in}" "$s"; do
chop="${in%%$s*}"
- out="${out}${chop
#
}$r"
+ out="${out}${chop}$r"
in="${in#*$s}"
done
echo "${out}${in}"