# HG changeset patch # User Michael Goffioul # Date 1207761198 14400 # Node ID ab14529b67de5f14c80c08e2562f434c1872a568 # Parent df16538e1b93a23edc1bd1168f6f473961bff364 Fix stat'ing root pathnames ('\' or '/') under Win32. diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2008-04-09 Michael Goffioul + + * 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 * lo-sysdep.cc [__WIN32__ && ! __CYGWIN__]: Include windows.h. diff --git a/liboctave/file-stat.cc b/liboctave/file-stat.cc --- 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