--- origsrc/lilypond-2.18.2/flower/file-name.cc 2014-03-17 15:29:16.000000000 +0000 +++ src/lilypond-2.18.2/flower/file-name.cc 2015-02-20 19:49:29.762829900 +0000 @@ -53,13 +53,14 @@ using namespace std; static string dos_to_posix (const string &file_name) { - char buf[PATH_MAX] = ""; - char s[PATH_MAX] = {0}; - file_name.copy (s, PATH_MAX - 1); - /* ugh: char const* argument gets modified. */ - int fail = cygwin_conv_to_posix_path (s, buf); - if (!fail) - return buf; + const char* const win32 = file_name.c_str(); + const ssize_t size = cygwin_conv_path(CCP_WIN_W_TO_POSIX | CCP_RELATIVE, win32, NULL, 0); + if (size >= 0) + { + std::vector posix(size, '\0'); + if (!cygwin_conv_path(CCP_WIN_W_TO_POSIX | CCP_RELATIVE, win32, &posix[0], size)) + return std::string(&posix[0], size); + } return file_name; } #endif /* __CYGWIN__ */