cocopon / vaffle.vim

:file_folder: Lightweight, window-based file manager for Vim
MIT License
284 stars 20 forks source link

Fix behavior when dirname includes dollar sign #23

Closed ichizok closed 6 years ago

ichizok commented 6 years ago

Problem

vaffle.vim behaves wrong on a directory whose path includes a dollar sign.

Repro steps

On unix-like system.

Preparation: create sample directories.

$ ls

$ mkdir -p \$foobar
$ mkdir -p \$foobar/001
$ touch \$foobar/002

($foobar is empty)

vimrc:

set rtp+=/path/to/vaffle.vim

Start Vim with vaffle.vim:

vim -Nu vimrc .

Display:

  $foobar/

Feed key l (move into $foobar),

Expected:

  001/
  002

Actual:

  /

Cause

A string starting with dollar sign is expanded as env variable by glob(), expand(). It should be escaped by fnameescape() properly.