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. */