X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Ffile-name.cc;h=188056675f94346469256f8112e8d3fbff384f9b;hb=307c47e1c42b98f17613a3cb58fa920dff6e1f32;hp=14812a034c39b87363c64d08372b0838750f6e8a;hpb=4a401ca1c60f428daa242dbdd102fdb3f327ebfb;p=lilypond.git diff --git a/flower/file-name.cc b/flower/file-name.cc index 14812a034c..188056675f 100644 --- a/flower/file-name.cc +++ b/flower/file-name.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2011 Han-Wen Nienhuys + Copyright (C) 1997--2014 Han-Wen Nienhuys Jan Nieuwenhuizen 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. */