diff --git a/README b/README index b88fa14..2a7f3b3 100644 --- a/README +++ b/README @@ -54,8 +54,6 @@ Similarly, "line match string" and "line replace string" are the search strings You may also use ui_print "" to write messages back to the recovery during the modification process, and contains "" "" to simplify string testing logic you might want in your script. -Note: the "begin search string" and "end search string" arguments of replace_section and remove_section require any forward slashes (/) to be escaped. - // Instructions 1- Place zImage in the root (dtb should also go here for devices that require a custom one, both will fallback to the original if not included) diff --git a/anykernel.sh b/anykernel.sh index cb63d95..5c8d6d1 100755 --- a/anykernel.sh +++ b/anykernel.sh @@ -116,13 +116,13 @@ replace_string() { # replace_section replace_section() { line=`grep -n "$2" $1 | cut -d: -f1`; - sed -i "/${2}/,/${3}/d" $1; + sed -i "/${2//\//\\/}/,/${3//\//\\/}/d" $1; sed -i "${line}s;^;${4}\n;" $1; } # remove_section remove_section() { - sed -i "/${2}/,/${3}/d" $1; + sed -i "/${2//\//\\/}/,/${3//\//\\/}/d" $1; } # insert_line