comparison liboctave/file-stat.cc @ 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 a1dbe9d80eee
children 424ba638d8f1 7cc783e52ddb
comparison
equal deleted inserted replaced
7704:1cdb42b372e8 7705:e9b9f74e0289
201 std::string full_file_name = file_ops::tilde_expand (file_name); 201 std::string full_file_name = file_ops::tilde_expand (file_name);
202 202
203 #if defined (__WIN32__) 203 #if defined (__WIN32__)
204 // Remove trailing slash. 204 // Remove trailing slash.
205 if (file_ops::is_dir_sep (full_file_name[full_file_name.length () - 1]) 205 if (file_ops::is_dir_sep (full_file_name[full_file_name.length () - 1])
206 && full_file_name.length () != 1
206 && ! (full_file_name.length() == 3 && full_file_name[1] == ':')) 207 && ! (full_file_name.length() == 3 && full_file_name[1] == ':'))
207 full_file_name.resize (full_file_name.length () - 1); 208 full_file_name.resize (full_file_name.length () - 1);
208 #endif 209 #endif
209 210
210 const char *cname = full_file_name.c_str (); 211 const char *cname = full_file_name.c_str ();