projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gettimeofday: port recent C++ fix to Emacs
[gnulib.git]
/
lib
/
clean-temp.c
diff --git
a/lib/clean-temp.c
b/lib/clean-temp.c
index
99c81d1
..
40ec02f
100644
(file)
--- a/
lib/clean-temp.c
+++ b/
lib/clean-temp.c
@@
-1,5
+1,6
@@
/* Temporary directories and temporary files with automatic cleanup.
/* Temporary directories and temporary files with automatic cleanup.
- Copyright (C) 2001, 2003, 2006-2007 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2006-2007, 2009-2013 Free Software Foundation,
+ Inc.
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
Written by Bruno Haible <bruno@clisp.org>, 2006.
This program is free software: you can redistribute it and/or modify
@@
-40,6
+41,7
@@
#include "tmpdir.h"
#include "xalloc.h"
#include "xmalloca.h"
#include "tmpdir.h"
#include "xalloc.h"
#include "xmalloca.h"
+#include "gl_xlist.h"
#include "gl_linkedhash_list.h"
#include "gettext.h"
#if GNULIB_FWRITEERROR
#include "gl_linkedhash_list.h"
#include "gettext.h"
#if GNULIB_FWRITEERROR
@@
-57,13
+59,10
@@
#define _(str) gettext (str)
#define _(str) gettext (str)
-/* GNU Hurd doesn't have PATH_MAX. */
+/* GNU Hurd doesn't have PATH_MAX. Use a fallback.
+ Temporary directory names are usually not that long. */
#ifndef PATH_MAX
#ifndef PATH_MAX
-# ifdef MAXPATHLEN
-# define PATH_MAX MAXPATHLEN
-# else
-# define PATH_MAX 1024
-# endif
+# define PATH_MAX 1024
#endif
#ifndef uintptr_t
#endif
#ifndef uintptr_t
@@
-557,7
+556,10
@@
cleanup_temp_dir (struct temp_dir *dir)
}
else
cleanup_list.tempdir_list[i] = NULL;
}
else
cleanup_list.tempdir_list[i] = NULL;
- /* Now only we can free the tmpdir->dirname and tmpdir itself. */
+ /* Now only we can free the tmpdir->dirname, tmpdir->subdirs,
+ tmpdir->files, and tmpdir itself. */
+ gl_list_free (tmpdir->files);
+ gl_list_free (tmpdir->subdirs);
free (tmpdir->dirname);
free (tmpdir);
return err;
free (tmpdir->dirname);
free (tmpdir);
return err;
@@
-584,6
+586,11
@@
supports_delete_on_close ()
{
OSVERSIONINFO v;
{
OSVERSIONINFO v;
+ /* According to
+ <http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx>
+ this structure must be initialised as follows: */
+ v.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+
if (GetVersionEx (&v))
known = (v.dwPlatformId == VER_PLATFORM_WIN32_NT ? 1 : -1);
else
if (GetVersionEx (&v))
known = (v.dwPlatformId == VER_PLATFORM_WIN32_NT ? 1 : -1);
else