Merge pull request #4259 from Mon-ius/master

fix a issue, when profile not end with newline
This commit is contained in:
neil 2022-10-05 14:20:01 +08:00 committed by GitHub
commit be477d7ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -2257,6 +2257,9 @@ _setopt() {
if [ ! -f "$__conf" ]; then
touch "$__conf"
fi
if [ -n "$(tail -c 1 <"$__conf")" ]; then
echo >>"$__conf"
fi
if grep -n "^$__opt$__sep" "$__conf" >/dev/null; then
_debug3 OK