/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
LilyPond is free software: you can redistribute it and/or modify
#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};
}
string
-dir_name (string const file_name)
+dir_name (const string &file_name)
{
string s = file_name;
s = slashify (s);
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. */