Errors during exiting of Vim: E121: Undefined variable: tmp #22

Closed
blueyed opened this Issue Mar 12, 2013 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

blueyed commented Mar 12, 2013

After using SudoWrite, I see the following error on exit:

Executing VimLeave Auto commands for "*"
autocommand :call SudoEdit#Rmdir(''/tmp/vwpmAmh/6'')

Error detected while processing VimLeave Auto commands for "*":
E121: Undefined variable: tmp
E116: Invalid arguments for function SudoEdit#Rmdir

This is caused because Mkdir(s:error_dir) is called with s:error_dir being escaped already, and the VimLeave autocommand adds additional quotes around it.

I think that Mkdir should take care of shell-escaping the argument.

Owner

chrisbra commented Mar 12, 2013

On Tue, March 12, 2013 16:34, Daniel Hahler wrote:

After using SudoWrite, I see the following error on exit:

Executing VimLeave Auto commands for "*"
autocommand :call SudoEdit#Rmdir(''/tmp/vwpmAmh/6'')

Error detected while processing VimLeave Auto commands for "*":
E121: Undefined variable: tmp
E116: Invalid arguments for function SudoEdit#Rmdir

This is caused because Mkdir(s:error_dir) is called with s:error_dir
being escaped already, and the VimLeave autocommand adds additional quotes
around it.

I think that Mkdir should take care of shell-escaping the argument.

Thanks for the info. I fixed it locally and push a fix later today.

regards,
Christian

@chrisbra chrisbra added a commit that referenced this issue Mar 12, 2013

@chrisbra chrisbra Don't twice escape the directory
Mkdir already is already called with an shellescaped parameter. No need
to quote it a second time for the Rmdir() call on VimExit.

Closes issue #22, reported by Daniel Hahler, thanks!
2ee31c2

chrisbra closed this Mar 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment