source file of the Flower Library
- (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
*/
#include "file-path.hh"
-#include "std-string.hh"
-
#include <cstdio>
#include <cerrno>
bool
is_dir (string file_name)
{
+ /*
+ canonicalize; in particular, trailing slashes should disappear.
+ */
+ file_name = File_name (file_name).to_string ();
+
#if !STAT_MACROS_BROKEN
struct stat sbuf;
if (stat (file_name.c_str (), &sbuf) != 0)