]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/file-path.cc
Imported Upstream version 2.14.2
[lilypond.git] / flower / file-path.cc
index 3fc85000729af83694f6b4397d5b0111bb71586e..97b9f24362f0d9a7dfd1a5e630ef8d6752663bd7 100644 (file)
@@ -1,16 +1,25 @@
 /*
-  file-path.cc - implement File_path
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the Flower Library
-
-  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
+
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "file-path.hh"
 
-#include "std-string.hh"
-
 #include <cstdio>
 #include <cerrno>
 
@@ -66,6 +75,11 @@ is_file (string file_name)
 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)