]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/file-name.cc
Merge tag 'upstream/2.18.0' into debian-experimental
[lilypond.git] / flower / file-name.cc
index c24c0731e4f237bccba2ac3dd1d0b8b450210a19..0ff89b8d874fb32f6f189470eb3c596c6cfd22f8 100644 (file)
@@ -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);
@@ -96,9 +96,13 @@ dir_name (string const file_name)
 string
 get_working_directory ()
 {
+#ifdef _GNU_SOURCE_
+  return string (get_current_dir_name());
+#else
   char cwd[PATH_MAX];
   // getcwd returns NULL upon a failure, contents of cwd would be undefined!
   return string (getcwd (cwd, PATH_MAX));
+#endif
 }
 
 /* Join components to full file_name. */