changeset 11746:ab14529b67de release-3-0-x

Fix stat'ing root pathnames ('\' or '/') under Win32.
author Michael Goffioul <michael.goffioul@gmail.com>
date Wed, 09 Apr 2008 13:13:18 -0400
parents df16538e1b93
children 8b77c3a5d87a
files liboctave/ChangeLog liboctave/file-stat.cc
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog
+++ b/liboctave/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-09  Michael Goffioul  <michael.goffioul@gmail.com>
+
+	* file-stat.cc (file_stat::update_internal): Do not strip trailing
+	file separator when path length is equal to 1 (handle case '\') under
+	__WIN32__ platforms.
+
 2008-04-03  John W. Eaton  <jwe@octave.org>
 
 	* lo-sysdep.cc [__WIN32__ && ! __CYGWIN__]: Include windows.h.
--- a/liboctave/file-stat.cc
+++ b/liboctave/file-stat.cc
@@ -203,6 +203,7 @@
 #if defined (__WIN32__)
       // Remove trailing slash.
       if (file_ops::is_dir_sep (full_file_name[full_file_name.length () - 1])
+	  && full_file_name.length () != 1
           && ! (full_file_name.length() == 3 && full_file_name[1] == ':'))
         full_file_name.resize (full_file_name.length () - 1);
 #endif