We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a3acff commit ff44bf3Copy full SHA for ff44bf3
customize.sh
@@ -197,9 +197,13 @@ restore_ini() {
197
for key in $keys; do
198
value=$(grep "^$key=" "$backup_ini")
199
if [ -n "$value" ]; then
200
+ # Escape special characters to make it safe for sed
201
+ esc_value=$(printf '%s\n' "$value" | sed -e 's/[&/\]/\\&/g')
202
+
203
if grep -q "^$key=" "$target_ini"; then
204
# Replace old line
- sed -i "s|^$key=.*|$value|" "$target_ini"
205
+ # sed -i "s|^$key=.*|$value|" "$target_ini"
206
+ sed -i "s|^$key=.*|$esc_value|" "$target_ini"
207
else
208
# Append at the end of the file
209
echo "$value" >> "$target_ini"
0 commit comments