On 2009-06-02, Till Maas <opensou...@till.name> wrote:
> On Tue June 2 2009, Gary Johnson wrote:
> > Svn is not installed on the Windows computers on which I use the
> > vim-latex suite, so I attempted to get the latest versions on /trunk
> > by downloading the tarball using the "Download GNU tarball" link on
> > this page:
> >
> >     http://vim-latex.svn.sourceforge.net/viewvc/vim-latex/trunk/vimfiles/
> >
> > I discovered several places in various plugin files where other
> > files were sourced without properly accounting for spaces in path
> > names.  I fixed each of these by adding calls to fnameescape().
> > Patches are attached.
> 
> Thank you for your patches. They have been applied in changeset 1051. Be 
> aware 
> that there may be other places that currently break in case there are spaces 
> in vim-latex. After I noticed this I also started to prepare a patch to use 
> fnameescape everywhere in vim-latex, but the patch is not yet ready. If 
> possible, I would prefer to get unified diffs as a patch and with the full 
> path to the files that are patched. That makes it a little easier to apply 
> them.

I just got around to downloading the latest tarball of
/trunk/vimfiles from SourceForge, version 1.8.23.  main.vim now
contains at least one too many calls to fnameescape().  In addition
to the ones I added in my patch, there is this one at line 28.

    let s:path = fnameescape(expand('<sfile>:p:h'))

This causes a problem when fnameescape() is applied again to s:path,
as on line 32,

    exe "so ".fnameescape(s:path.'/texrc')

The second fnameescape() sees the escapes added by the first
fnameescape() as part of the file name and escapes them, causing the
OS to also see those first escapes as part of the file name.

fnameescape() must be applied only once to the components of any
path.

The solution is to remove the call to fnameescape() from line 28.
A patch is attached.  I hope it's in the right format this time.

An alternative solution would be to keep line 28 as it is and remove
most if not all of the other occurrences of fnameescape().  I think
it's better practice, though, to not escape a file name until it's
given to the OS.

I didn't check to see if there were other places where fnameescape()
was applied too often.

Regards,
Gary
--- vimfiles/ftplugin/latex-suite/main.vim.orig 2009-08-31 23:12:10.140625000 
-0700
+++ vimfiles/ftplugin/latex-suite/main.vim      2009-08-31 23:18:15.968750000 
-0700
@@ -25,7 +25,7 @@
 
 " get the place where this plugin resides for setting cpt and dict options.
 " these lines need to be outside the function.
-let s:path = fnameescape(expand('<sfile>:p:h'))
+let s:path = expand('<sfile>:p:h')
 " set up personal defaults.
 runtime ftplugin/tex/texrc
 " set up global defaults.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Reply via email to