]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/file-name.cc
Get rid of some compiler warnings; Fix chdir handling of errors
[lilypond.git] / flower / file-name.cc
index 14812a034c39b87363c64d08372b0838750f6e8a..27ce6df6f8ef799193866636c6fceed86607fb54 100644 (file)
@@ -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. */