Loading ...
Sorry, an error occurred while loading the content.
 

Patch 7.1.305

Expand Messages
  • Bram Moolenaar
    Patch 7.1.305 Problem: Editing a compressed file with special characters in the name doesn t work properly. Solution: Escape special characters. Files:
    Message 1 of 1 , May 29, 2008
      Patch 7.1.305
      Problem: Editing a compressed file with special characters in the name
      doesn't work properly.
      Solution: Escape special characters.
      Files: runtime/autoload/gzip.vim


      *** ../vim-7.1.304/runtime/autoload/gzip.vim Thu May 10 18:54:26 2007
      --- runtime/autoload/gzip.vim Thu May 29 22:30:59 2008
      ***************
      *** 1,6 ****
      " Vim autoload file for editing compressed files.
      " Maintainer: Bram Moolenaar <Bram@...>
      ! " Last Change: 2007 May 10

      " These functions are used by the gzip plugin.

      --- 1,6 ----
      " Vim autoload file for editing compressed files.
      " Maintainer: Bram Moolenaar <Bram@...>
      ! " Last Change: 2008 May 29

      " These functions are used by the gzip plugin.

      ***************
      *** 73,80 ****
      let empty = line("'[") == 1 && line("']") == line("$")
      let tmp = tempname()
      let tmpe = tmp . "." . expand("<afile>:e")
      " write the just read lines to a temp file "'[,']w tmp.gz"
      ! execute "silent '[,']w " . escape(tmpe, ' ')
      " uncompress the temp file: call system("gzip -dn tmp.gz")
      call system(a:cmd . " " . s:escape(tmpe))
      if !filereadable(tmp)
      --- 73,87 ----
      let empty = line("'[") == 1 && line("']") == line("$")
      let tmp = tempname()
      let tmpe = tmp . "." . expand("<afile>:e")
      + if exists('*fnameescape')
      + let tmp_esc = fnameescape(tmp)
      + let tmpe_esc = fnameescape(tmpe)
      + else
      + let tmp_esc = escape(tmp, ' ')
      + let tmpe_esc = escape(tmpe, ' ')
      + endif
      " write the just read lines to a temp file "'[,']w tmp.gz"
      ! execute "silent '[,']w " . tmpe_esc
      " uncompress the temp file: call system("gzip -dn tmp.gz")
      call system(a:cmd . " " . s:escape(tmpe))
      if !filereadable(tmp)
      ***************
      *** 95,106 ****
      setlocal nobin
      if exists(":lockmarks")
      if empty
      ! execute "silent lockmarks " . l . "r ++edit " . tmp
      else
      ! execute "silent lockmarks " . l . "r " . tmp
      endif
      else
      ! execute "silent " . l . "r " . tmp
      endif

      " if buffer became empty, delete trailing blank line
      --- 102,113 ----
      setlocal nobin
      if exists(":lockmarks")
      if empty
      ! execute "silent lockmarks " . l . "r ++edit " . tmp_esc
      else
      ! execute "silent lockmarks " . l . "r " . tmp_esc
      endif
      else
      ! execute "silent " . l . "r " . tmp_esc
      endif

      " if buffer became empty, delete trailing blank line
      ***************
      *** 110,117 ****
      endif
      " delete the temp file and the used buffers
      call delete(tmp)
      ! silent! exe "bwipe " . tmp
      ! silent! exe "bwipe " . tmpe
      endif

      " Restore saved option values.
      --- 117,124 ----
      endif
      " delete the temp file and the used buffers
      call delete(tmp)
      ! silent! exe "bwipe " . tmp_esc
      ! silent! exe "bwipe " . tmpe_esc
      endif

      " Restore saved option values.
      ***************
      *** 124,133 ****

      " When uncompressed the whole buffer, do autocommands
      if ok && empty
      if &verbose >= 8
      ! execute "doau BufReadPost " . expand("%:r")
      else
      ! execute "silent! doau BufReadPost " . expand("%:r")
      endif
      endif
      endfun
      --- 131,145 ----

      " When uncompressed the whole buffer, do autocommands
      if ok && empty
      + if exists('*fnameescape')
      + let fname = fnameescape(expand("%:r"))
      + else
      + let fname = escape(expand("%:r"), " \t\n*?[{`$\\%#'\"|!<")
      + endif
      if &verbose >= 8
      ! execute "doau BufReadPost " . fname
      else
      ! execute "silent! doau BufReadPost " . fname
      endif
      endif
      endfun
      *** ../vim-7.1.304/src/version.c Thu May 29 21:46:10 2008
      --- src/version.c Thu May 29 22:33:11 2008
      ***************
      *** 668,669 ****
      --- 673,676 ----
      { /* Add new patch number below this line */
      + /**/
      + 305,
      /**/

      --
      OLD WOMAN: Well, how did you become king, then?
      ARTHUR: The Lady of the Lake, her arm clad in the purest shimmering samite,
      held Excalibur aloft from the bosom of the water to signify by Divine
      Providence ... that I, Arthur, was to carry Excalibur ... That is
      why I am your king!
      "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.