]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/file-name.cc
Merge branch 'translation' of ssh://git.sv.gnu.org/srv/git/lilypond into translation
[lilypond.git] / flower / file-name.cc
index 14812a034c39b87363c64d08372b0838750f6e8a..c24c0731e4f237bccba2ac3dd1d0b8b450210a19 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--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
 
   LilyPond is free software: you can redistribute it and/or modify
@@ -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. */