0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.2-294

This commit is contained in:
Bram Moolenaar 2009-11-17 11:08:52 +00:00
parent d7d5b47dc7
commit eaf0339211
5 changed files with 60 additions and 35 deletions

3
src/auto/configure vendored
View File

@ -14017,11 +14017,12 @@ fi
for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \ for ac_func in bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
memset nanosleep opendir putenv qsort readlink select setenv \ memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
sigvec strcasecmp strerror strftime stricmp strncasecmp \ sigvec strcasecmp strerror strftime stricmp strncasecmp \
strnicmp strpbrk strtol tgetent towlower towupper iswupper \ strnicmp strpbrk strtol tgetent towlower towupper iswupper \

View File

@ -157,6 +157,7 @@
#undef HAVE_LSTAT #undef HAVE_LSTAT
#undef HAVE_MEMCMP #undef HAVE_MEMCMP
#undef HAVE_MEMSET #undef HAVE_MEMSET
#undef HAVE_MKDTEMP
#undef HAVE_NANOSLEEP #undef HAVE_NANOSLEEP
#undef HAVE_OPENDIR #undef HAVE_OPENDIR
#undef HAVE_FLOAT_FUNCS #undef HAVE_FLOAT_FUNCS

View File

@ -2635,7 +2635,7 @@ fi
dnl Check for functions in one big call, to reduce the size of configure dnl Check for functions in one big call, to reduce the size of configure
AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \ AC_CHECK_FUNCS(bcmp fchdir fchown fseeko fsync ftello getcwd getpseudotty \
getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \ getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
memset nanosleep opendir putenv qsort readlink select setenv \ memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \ setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
sigvec strcasecmp strerror strftime stricmp strncasecmp \ sigvec strcasecmp strerror strftime stricmp strncasecmp \
strnicmp strpbrk strtol tgetent towlower towupper iswupper \ strnicmp strpbrk strtol tgetent towlower towupper iswupper \

View File

@ -146,6 +146,7 @@ static int get_mac_fio_flags __ARGS((char_u *ptr));
# endif # endif
#endif #endif
static int move_lines __ARGS((buf_T *frombuf, buf_T *tobuf)); static int move_lines __ARGS((buf_T *frombuf, buf_T *tobuf));
static void vim_settempdir __ARGS((char_u *tempdir));
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name"); static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name");
#endif #endif
@ -6986,6 +6987,33 @@ vim_deltempdir()
} }
#endif #endif
/*
* Directory "tempdir" was created. Expand this name to a full path and put
* it in "vim_tempdir". This avoids that using ":cd" would confuse us.
* "tempdir" must be no longer than MAXPATHL.
*/
static void
vim_settempdir(tempdir)
char_u *tempdir;
{
char_u *buf;
buf = alloc((unsigned)MAXPATHL + 2);
if (buf != NULL)
{
if (vim_FullName(tempdir, buf, MAXPATHL, FALSE) == FAIL)
STRCPY(buf, tempdir);
# ifdef __EMX__
if (vim_strchr(buf, '/') != NULL)
STRCAT(buf, "/");
else
# endif
add_pathsep(buf);
vim_tempdir = vim_strsave(buf);
vim_free(buf);
}
}
/* /*
* vim_tempname(): Return a unique name that can be used for a temp file. * vim_tempname(): Return a unique name that can be used for a temp file.
* *
@ -7007,8 +7035,6 @@ vim_tempname(extra_char)
#ifdef TEMPDIRNAMES #ifdef TEMPDIRNAMES
static char *(tempdirs[]) = {TEMPDIRNAMES}; static char *(tempdirs[]) = {TEMPDIRNAMES};
int i; int i;
long nr;
long off;
# ifndef EEXIST # ifndef EEXIST
struct stat st; struct stat st;
# endif # endif
@ -7027,6 +7053,12 @@ vim_tempname(extra_char)
*/ */
for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i) for (i = 0; i < (int)(sizeof(tempdirs) / sizeof(char *)); ++i)
{ {
size_t itmplen;
# ifndef HAVE_MKDTEMP
long nr;
long off;
# endif
/* expand $TMP, leave room for "/v1100000/999999999" */ /* expand $TMP, leave room for "/v1100000/999999999" */
expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20); expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20);
if (mch_isdir(itmp)) /* directory exists */ if (mch_isdir(itmp)) /* directory exists */
@ -7040,7 +7072,14 @@ vim_tempname(extra_char)
else else
# endif # endif
add_pathsep(itmp); add_pathsep(itmp);
itmplen = STRLEN(itmp);
# ifdef HAVE_MKDTEMP
/* Leave room for filename */
STRCAT(itmp, "vXXXXXX");
if (mkdtemp((char *)itmp) != NULL)
vim_settempdir(itmp);
# else
/* Get an arbitrary number of up to 6 digits. When it's /* Get an arbitrary number of up to 6 digits. When it's
* unlikely that it already exists it will be faster, * unlikely that it already exists it will be faster,
* otherwise it doesn't matter. The use of mkdir() avoids any * otherwise it doesn't matter. The use of mkdir() avoids any
@ -7052,59 +7091,41 @@ vim_tempname(extra_char)
for (off = 0; off < 10000L; ++off) for (off = 0; off < 10000L; ++off)
{ {
int r; int r;
#if defined(UNIX) || defined(VMS) # if defined(UNIX) || defined(VMS)
mode_t umask_save; mode_t umask_save;
#endif # endif
sprintf((char *)itmp + STRLEN(itmp), "v%ld", nr + off); sprintf((char *)itmp + itmplen, "v%ld", nr + off);
# ifndef EEXIST # ifndef EEXIST
/* If mkdir() does not set errno to EEXIST, check for /* If mkdir() does not set errno to EEXIST, check for
* existing file here. There is a race condition then, * existing file here. There is a race condition then,
* although it's fail-safe. */ * although it's fail-safe. */
if (mch_stat((char *)itmp, &st) >= 0) if (mch_stat((char *)itmp, &st) >= 0)
continue; continue;
# endif # endif
#if defined(UNIX) || defined(VMS) # if defined(UNIX) || defined(VMS)
/* Make sure the umask doesn't remove the executable bit. /* Make sure the umask doesn't remove the executable bit.
* "repl" has been reported to use "177". */ * "repl" has been reported to use "177". */
umask_save = umask(077); umask_save = umask(077);
#endif # endif
r = vim_mkdir(itmp, 0700); r = vim_mkdir(itmp, 0700);
#if defined(UNIX) || defined(VMS) # if defined(UNIX) || defined(VMS)
(void)umask(umask_save); (void)umask(umask_save);
#endif # endif
if (r == 0) if (r == 0)
{ {
char_u *buf; vim_settempdir(itmp);
/* Directory was created, use this name.
* Expand to full path; When using the current
* directory a ":cd" would confuse us. */
buf = alloc((unsigned)MAXPATHL + 1);
if (buf != NULL)
{
if (vim_FullName(itmp, buf, MAXPATHL, FALSE)
== FAIL)
STRCPY(buf, itmp);
# ifdef __EMX__
if (vim_strchr(buf, '/') != NULL)
STRCAT(buf, "/");
else
# endif
add_pathsep(buf);
vim_tempdir = vim_strsave(buf);
vim_free(buf);
}
break; break;
} }
# ifdef EEXIST # ifdef EEXIST
/* If the mkdir() didn't fail because the file/dir exists, /* If the mkdir() didn't fail because the file/dir exists,
* we probably can't create any dir here, try another * we probably can't create any dir here, try another
* place. */ * place. */
if (errno != EEXIST) if (errno != EEXIST)
# endif # endif
break; break;
} }
# endif /* HAVE_MKDTEMP */
if (vim_tempdir != NULL) if (vim_tempdir != NULL)
break; break;
} }

View File

@ -681,6 +681,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
294,
/**/ /**/
293, 293,
/**/ /**/