changeset 6810:56a7de3f6451

[project @ 2007-08-10 18:53:49 by jwe]
author jwe
date Fri, 10 Aug 2007 18:53:49 +0000
parents 5e61f0bc0c27
children 3fe394f8502b
files liboctave/ChangeLog liboctave/file-stat.cc
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog	Fri Aug 10 18:41:34 2007 +0000
+++ b/liboctave/ChangeLog	Fri Aug 10 18:53:49 2007 +0000
@@ -1,3 +1,9 @@
+2007-08-10  Michael Goffioul <michael.goffioul@gmail.com>
+
+	* file-stat.cc (file_stat::update_internal) [__WIN32__]:
+	Remove trailing dir separator when stat'ing directory except for
+	root directory.
+
 2007-07-25  David Bateman  <dbateman@free.fr>
 	
 	* Makefile.in: 	Adjust DISTFILES to allow out of tree "make dist" 
--- a/liboctave/file-stat.cc	Fri Aug 10 18:41:34 2007 +0000
+++ b/liboctave/file-stat.cc	Fri Aug 10 18:53:49 2007 +0000
@@ -200,6 +200,13 @@
       
       std::string full_file_name = file_ops::tilde_expand (file_name);
 
+#if defined (__WIN32__)
+      // Remove trailing slash.
+      if (file_ops::is_dir_sep (full_file_name[full_file_name.length () - 1])
+          && ! (full_file_name.length() == 3 && full_file_name[1] == ':'))
+        full_file_name.resize (full_file_name.length () - 1);
+#endif
+
       const char *cname = full_file_name.c_str ();
 
       struct stat buf;