]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/file-name.cc
Run grand replace for 2015.
[lilypond.git] / flower / file-name.cc
index 14812a034c39b87363c64d08372b0838750f6e8a..eaadadf3efc071f34ac0610d7cc5db3ef55beded 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
 
   LilyPond is free software: you can redistribute it and/or modify
@@ -51,7 +51,7 @@ using namespace std;
 
 #ifdef __CYGWIN__
 static string
-dos_to_posix (string file_name)
+dos_to_posix (const string &file_name)
 {
   char buf[PATH_MAX] = "";
   char s[PATH_MAX] = {0};
@@ -78,7 +78,7 @@ slashify (string file_name)
 }
 
 string
-dir_name (string const file_name)
+dir_name (const string &file_name)
 {
   string s = file_name;
   s = slashify (s);
@@ -97,9 +97,8 @@ string
 get_working_directory ()
 {
   char cwd[PATH_MAX];
-  getcwd (cwd, PATH_MAX);
-
-  return string (cwd);
+  // getcwd returns NULL upon a failure, contents of cwd would be undefined!
+  return string (getcwd (cwd, PATH_MAX));
 }
 
 /* Join components to full file_name. */