aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <pcmsinan@gmail.com>2023-03-17 11:17:27 +0530
committersinanmohd <pcmsinan@gmail.com>2023-03-17 11:17:27 +0530
commitddf226573ed20deda59030ad4664339eab3c3e5d (patch)
treea4ebd93910e6affe2d27e8ad3039b4dcd85dc9cb
parentf6341b0c37703d02776945d70db7273e99ffdbe6 (diff)
dbook: preserve spacing of config file when using -d
-rwxr-xr-xdbook5
1 files changed, 4 insertions, 1 deletions
diff --git a/dbook b/dbook
index 3f7b693..487011e 100755
--- a/dbook
+++ b/dbook
@@ -99,7 +99,9 @@ rm_data()
data=
cl=
file=
+ oid_ifs="$IFS"
+ IFS=
while read -r line
do
cl="$line\n"
@@ -130,10 +132,11 @@ rm_data()
file="${file}${cl}"
done < "$book_conf"
+ IFS="$old_ifs"
# shellcheck disable=SC2059
printf "$file" > "$book_conf"
- unset read_name data file cl
+ unset read_name data file cl old_ifs
}
entry()