changeset 7705:e9b9f74e0289

Fix stat'ing root pathnames ('\' or '/') under Win32.
author Michael Goffioul <michael.goffioul@gmail.com>
date Wed, 09 Apr 2008 13:12:27 -0400
parents 1cdb42b372e8
children 30564b8b19f5
files liboctave/ChangeLog liboctave/file-stat.cc
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/ChangeLog	Wed Apr 09 12:56:48 2008 -0400
+++ b/liboctave/ChangeLog	Wed Apr 09 13:12:27 2008 -0400
@@ -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-07  Jaroslav Hajek <highegg@gmail.com>
 
 	* dbleQR.h, dbleQR.cc (QR::shift_cols): New method.
--- a/liboctave/file-stat.cc	Wed Apr 09 12:56:48 2008 -0400
+++ b/liboctave/file-stat.cc	Wed Apr 09 13:12:27 2008 -0400
@@ -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