4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Editing a compressed file with special characters in the name
12 doesn't work properly.
13 Solution: Escape special characters.
14 Files: runtime/autoload/gzip.vim
17 *** ../vim-7.1.304/runtime/autoload/gzip.vim Thu May 10 18:54:26 2007
18 --- runtime/autoload/gzip.vim Thu May 29 22:30:59 2008
21 " Vim autoload file for editing compressed files.
22 " Maintainer: Bram Moolenaar <Bram@vim.org>
23 ! " Last Change: 2007 May 10
25 " These functions are used by the gzip plugin.
28 " Vim autoload file for editing compressed files.
29 " Maintainer: Bram Moolenaar <Bram@vim.org>
30 ! " Last Change: 2008 May 29
32 " These functions are used by the gzip plugin.
36 let empty = line("'[") == 1 && line("']") == line("$")
38 let tmpe = tmp . "." . expand("<afile>:e")
39 " write the just read lines to a temp file "'[,']w tmp.gz"
40 ! execute "silent '[,']w " . escape(tmpe, ' ')
41 " uncompress the temp file: call system("gzip -dn tmp.gz")
42 call system(a:cmd . " " . s:escape(tmpe))
45 let empty = line("'[") == 1 && line("']") == line("$")
47 let tmpe = tmp . "." . expand("<afile>:e")
48 + if exists('*fnameescape')
49 + let tmp_esc = fnameescape(tmp)
50 + let tmpe_esc = fnameescape(tmpe)
52 + let tmp_esc = escape(tmp, ' ')
53 + let tmpe_esc = escape(tmpe, ' ')
55 " write the just read lines to a temp file "'[,']w tmp.gz"
56 ! execute "silent '[,']w " . tmpe_esc
57 " uncompress the temp file: call system("gzip -dn tmp.gz")
58 call system(a:cmd . " " . s:escape(tmpe))
63 if exists(":lockmarks")
65 ! execute "silent lockmarks " . l . "r ++edit " . tmp
67 ! execute "silent lockmarks " . l . "r " . tmp
70 ! execute "silent " . l . "r " . tmp
73 " if buffer became empty, delete trailing blank line
76 if exists(":lockmarks")
78 ! execute "silent lockmarks " . l . "r ++edit " . tmp_esc
80 ! execute "silent lockmarks " . l . "r " . tmp_esc
83 ! execute "silent " . l . "r " . tmp_esc
86 " if buffer became empty, delete trailing blank line
90 " delete the temp file and the used buffers
92 ! silent! exe "bwipe " . tmp
93 ! silent! exe "bwipe " . tmpe
96 " Restore saved option values.
99 " delete the temp file and the used buffers
101 ! silent! exe "bwipe " . tmp_esc
102 ! silent! exe "bwipe " . tmpe_esc
105 " Restore saved option values.
109 " When uncompressed the whole buffer, do autocommands
112 ! execute "doau BufReadPost " . expand("%:r")
114 ! execute "silent! doau BufReadPost " . expand("%:r")
120 " When uncompressed the whole buffer, do autocommands
122 + if exists('*fnameescape')
123 + let fname = fnameescape(expand("%:r"))
125 + let fname = escape(expand("%:r"), " \t\n*?[{`$\\%#'\"|!<")
128 ! execute "doau BufReadPost " . fname
130 ! execute "silent! doau BufReadPost " . fname
134 *** ../vim-7.1.304/src/version.c Thu May 29 21:46:10 2008
135 --- src/version.c Thu May 29 22:33:11 2008
139 { /* Add new patch number below this line */
145 OLD WOMAN: Well, how did you become king, then?
146 ARTHUR: The Lady of the Lake, her arm clad in the purest shimmering samite,
147 held Excalibur aloft from the bosom of the water to signify by Divine
148 Providence ... that I, Arthur, was to carry Excalibur ... That is
150 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
152 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
153 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
154 \\\ download, build and distribute -- http://www.A-A-P.org ///
155 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///