1
0
Fork 0
mirror of git://slackware.nl/current.git synced 2025-02-15 08:50:09 +01:00
slackware-current/source/ap/vim/patches/7.3.025
Patrick J Volkerding 75a4a592e5 Slackware 13.37
Mon Apr 25 13:37:00 UTC 2011
Slackware 13.37 x86_64 stable is released!

Thanks to everyone who pitched in on this release: the Slackware team,
the folks producing upstream code, and linuxquestions.org for providing
a great forum for collaboration and testing.

The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a
dual-sided
32-bit/64-bit x86/x86_64 DVD.  Please consider supporting the Slackware
project by picking up a copy from store.slackware.com.  We're taking
pre-orders now, and offer a discount if you sign up for a subscription.

As always, thanks to the Slackware community for testing, suggestions,
and feedback.  :-)

Have fun!
2018-05-31 22:45:18 +02:00

136 lines
3.3 KiB
Text

To: vim-dev@vim.org
Subject: Patch 7.3.025
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 7.3.025
Problem: ":mksession" does not square brackets escape file name properly.
Solution: Improve escapging of file names. (partly by Peter Odding)
Files: src/ex_docmd.c
*** ../vim-7.3.024/src/ex_docmd.c 2010-09-21 16:56:29.000000000 +0200
--- src/ex_docmd.c 2010-10-13 17:39:17.000000000 +0200
***************
*** 10708,10714 ****
* Write a file name to the session file.
* Takes care of the "slash" option in 'sessionoptions' and escapes special
* characters.
! * Returns FAIL if writing fails.
*/
static int
ses_put_fname(fd, name, flagp)
--- 10708,10714 ----
* Write a file name to the session file.
* Takes care of the "slash" option in 'sessionoptions' and escapes special
* characters.
! * Returns FAIL if writing fails or out of memory.
*/
static int
ses_put_fname(fd, name, flagp)
***************
*** 10717,10765 ****
unsigned *flagp;
{
char_u *sname;
int retval = OK;
- int c;
sname = home_replace_save(NULL, name);
! if (sname != NULL)
! name = sname;
! while (*name != NUL)
! {
! #ifdef FEAT_MBYTE
! {
! int l;
! if (has_mbyte && (l = (*mb_ptr2len)(name)) > 1)
! {
! /* copy a multibyte char */
! while (--l >= 0)
! {
! if (putc(*name, fd) != *name)
! retval = FAIL;
! ++name;
! }
! continue;
! }
! }
! #endif
! c = *name++;
! if (c == '\\' && (*flagp & SSOP_SLASH))
! /* change a backslash to a forward slash */
! c = '/';
! else if ((vim_strchr(escape_chars, c) != NULL
! #ifdef BACKSLASH_IN_FILENAME
! && c != '\\'
! #endif
! ) || c == '#' || c == '%')
! {
! /* escape a special character with a backslash */
! if (putc('\\', fd) != '\\')
! retval = FAIL;
! }
! if (putc(c, fd) != c)
! retval = FAIL;
}
vim_free(sname);
return retval;
}
--- 10717,10748 ----
unsigned *flagp;
{
char_u *sname;
+ char_u *p;
int retval = OK;
sname = home_replace_save(NULL, name);
! if (sname == NULL)
! return FAIL;
! if (*flagp & SSOP_SLASH)
! {
! /* change all backslashes to forward slashes */
! for (p = sname; *p != NUL; mb_ptr_adv(p))
! if (*p == '\\')
! *p = '/';
}
+
+ /* escapse special characters */
+ p = vim_strsave_fnameescape(sname, FALSE);
vim_free(sname);
+ if (p == NULL)
+ return FAIL;
+
+ /* write the result */
+ if (fputs((char *)p, fd) < 0)
+ retval = FAIL;
+
+ vim_free(p);
return retval;
}
*** ../vim-7.3.024/src/version.c 2010-10-13 16:44:17.000000000 +0200
--- src/version.c 2010-10-13 17:49:15.000000000 +0200
***************
*** 716,717 ****
--- 716,719 ----
{ /* Add new patch number below this line */
+ /**/
+ 25,
/**/
--
"Time flies like an arrow". So I put an arrow on my desk, now
awaiting one of these time flies showing up.
/// Bram Moolenaar -- Bram@Moolenaar.net -- 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 ///