changeset 11626:09f833d41f68 release-3-0-x

[3-0-0-branch @ 2008-01-30 07:57:48 by jwe]
author jwe
date Wed, 30 Jan 2008 07:57:49 +0000
parents ccf8e0410ee0
children c12c1e81542f
files scripts/ChangeLog scripts/miscellaneous/tempdir.m
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Jan 30 07:44:18 2008 +0000
+++ b/scripts/ChangeLog	Wed Jan 30 07:57:49 2008 +0000
@@ -1,5 +1,9 @@
 2008-01-30  John W. Eaton  <jwe@octave.org>
 
+	* miscellaneous/tempdir.m: Append filesep to name for
+	compatibility.  Warn if not a directory or directory does not
+	exist.
+
 	* strings/deblank.m: Improve compatibility.
 
 2008-01-28  Michael Goffioul <michael.goffioul@gmail.com>
--- a/scripts/miscellaneous/tempdir.m	Wed Jan 30 07:44:18 2008 +0000
+++ b/scripts/miscellaneous/tempdir.m	Wed Jan 30 07:57:49 2008 +0000
@@ -24,8 +24,16 @@
 function dirname = tempdir ()
 
   dirname = getenv ("TMPDIR");
-  if (length (dirname) == 0)
+  if (isempty (dirname))
     dirname = P_tmpdir;
   endif
 
+  if (! strcmp (dirname(end), filesep))
+    strcat (dirname, filesep);
+  endif
+
+  if (! isdir (dirname))
+    warning ("tempdir: `%s' does not exist or is not a directory", dirname);
+  endif
+
 endfunction