X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fclean-temp.c;h=5e400d51660b1387b10bc799c838efd1fb20b7cd;hb=cd56634a4a8179fd5a4419fbb3e27211b042ab1c;hp=619912806913e2aa43f8bf2514bc4213dbe432c5;hpb=766d4f1de6c26bb084382524eaed00b45ab3112c;p=gnulib.git diff --git a/lib/clean-temp.c b/lib/clean-temp.c index 619912806..5e400d516 100644 --- a/lib/clean-temp.c +++ b/lib/clean-temp.c @@ -1,5 +1,6 @@ /* Temporary directories and temporary files with automatic cleanup. - Copyright (C) 2001, 2003, 2006-2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2006-2007, 2009-2014 Free Software Foundation, + Inc. Written by Bruno Haible , 2006. This program is free software: you can redistribute it and/or modify @@ -58,13 +59,10 @@ #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 -# ifdef MAXPATHLEN -# define PATH_MAX MAXPATHLEN -# else -# define PATH_MAX 1024 -# endif +# define PATH_MAX 1024 #endif #ifndef uintptr_t @@ -558,7 +556,10 @@ cleanup_temp_dir (struct temp_dir *dir) } 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; @@ -585,6 +586,11 @@ supports_delete_on_close () { OSVERSIONINFO v; + /* According to + + this structure must be initialised as follows: */ + v.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); + if (GetVersionEx (&v)) known = (v.dwPlatformId == VER_PLATFORM_WIN32_NT ? 1 : -1); else