diff liboctave/file-stat.cc @ 6810:56a7de3f6451

[project @ 2007-08-10 18:53:49 by jwe]
author jwe
date Fri, 10 Aug 2007 18:53:49 +0000
parents b9fd54407c8d
children 93c65f2a5668
line wrap: on
line diff
--- a/liboctave/file-stat.cc
+++ b/liboctave/file-stat.cc
@@ -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;