From 4fbb778b096abaccad149039c243a8e1a03a63b4 Mon Sep 17 00:00:00 2001 From: edyfox Date: Sun, 2 Dec 2007 13:44:58 +0000 Subject: [PATCH] Merged from the latest developing branch. git-svn-id: https://vim.svn.sourceforge.net/svnroot/vim/trunk@683 2a77ed30-b011-0410-a7ad-c7884a0aa172 --- src/ops.c | 7 ++++--- src/os_unix.c | 37 +++++++++++++++++++------------------ src/version.c | 4 ++++ 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/ops.c b/src/ops.c index ea5e20bd..82107cc4 100644 --- a/src/ops.c +++ b/src/ops.c @@ -927,8 +927,8 @@ get_register(name, copy) int name; int copy; /* make a copy, if FALSE make register empty. */ { - static struct yankreg *reg; - int i; + struct yankreg *reg; + int i; #ifdef FEAT_CLIPBOARD /* When Visual area changed, may have to update selection. Obtain the @@ -967,7 +967,7 @@ get_register(name, copy) } /* - * Put "reg" into register "name". Free any previous contents. + * Put "reg" into register "name". Free any previous contents and "reg". */ void put_register(name, reg) @@ -977,6 +977,7 @@ put_register(name, reg) get_yank_register(name, 0); free_yank_all(); *y_current = *(struct yankreg *)reg; + vim_free(reg); # ifdef FEAT_CLIPBOARD /* Send text written to clipboard register to the clipboard. */ diff --git a/src/os_unix.c b/src/os_unix.c index c062ad1b..3acd6acc 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -310,7 +310,7 @@ mch_write(s, len) } /* - * mch_inchar(): low level input funcion. + * mch_inchar(): low level input function. * Get a characters from the keyboard. * Return the number of characters that are available. * If wtime == 0 do not wait for characters. @@ -1567,18 +1567,19 @@ get_x11_windis() #ifdef FEAT_XCLIPBOARD if (xterm_dpy != NULL && x11_window != 0) { - /* Checked it already. */ - if (x11_display_from == XD_XTERM) - return OK; - - /* - * If the X11 display was opened here before, for the window where Vim - * was started, close that one now to avoid a memory leak. - */ - if (x11_display_from == XD_HERE && x11_display != NULL) - XCloseDisplay(x11_display); - x11_display = xterm_dpy; - x11_display_from = XD_XTERM; + /* We may have checked it already, but Gnome terminal can move us to + * another window, so we need to check every time. */ + if (x11_display_from != XD_XTERM) + { + /* + * If the X11 display was opened here before, for the window where + * Vim was started, close that one now to avoid a memory leak. + */ + if (x11_display_from == XD_HERE && x11_display != NULL) + XCloseDisplay(x11_display); + x11_display = xterm_dpy; + x11_display_from = XD_XTERM; + } if (test_x11_window(x11_display) == FAIL) { /* probably bad $WINDOWID */ @@ -2421,7 +2422,7 @@ mch_isFullName(fname) /* * Set the case of the file name, if it already exists. This will cause the * file name to remain exactly the same. - * Only required for file systems where case is ingored and preserved. + * Only required for file systems where case is ignored and preserved. */ /*ARGSUSED*/ void @@ -4653,7 +4654,7 @@ RealWaitForChar(fd, msec, check_for_gpm) ret = poll(fds, nfd, towait); # ifdef FEAT_MZSCHEME if (ret == 0 && mzquantum_used) - /* MzThreads scheduling is required and timeout occured */ + /* MzThreads scheduling is required and timeout occurred */ finished = FALSE; # endif @@ -4801,7 +4802,7 @@ RealWaitForChar(fd, msec, check_for_gpm) #endif # ifdef FEAT_MZSCHEME if (ret == 0 && mzquantum_used) - /* loop if MzThreads must be scheduled and timeout occured */ + /* loop if MzThreads must be scheduled and timeout occurred */ finished = FALSE; # endif @@ -5191,7 +5192,7 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags) { /* When using system() always add extra quotes, because the shell * is started twice. Otherwise put a backslash before special - * characters, except insice ``. */ + * characters, except inside ``. */ #ifdef USE_SYSTEM STRCAT(command, " \""); STRCAT(command, pat[i]); @@ -5675,7 +5676,7 @@ gpm_open() /* gpm library tries to handling TSTP causes * problems. Anyways, we close connection to Gpm whenever * we are going to suspend or starting an external process - * so we should'nt have problem with this + * so we shouldn't have problem with this */ signal(SIGTSTP, restricted ? SIG_IGN : SIG_DFL); return 1; /* succeed */ diff --git a/src/version.c b/src/version.c index 1aecf6c2..3f1aa85f 100644 --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,10 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 166, +/**/ + 165, +/**/ 164, /**/ 163, -- 2.11.4.GIT