If we call expand('%p') in a unnamed buffer, we will get an empty
string "". shellescape("") returns an escaped string "''" which
is not empty. So the determine whether a path is empty in current
code takes no effect.
Determine the emptyness using result of expand('%p') fixes this bug.
If we call
expand('%p')
in a unnamed buffer, we will get an empty string "".shellescape("")
returns an escaped string "''" which is not empty. So the determine whether a path is empty in current code takes no effect.Determine the emptyness using result of
expand('%p')
fixes this bug.