#include <config.h>
#include "support/lyxlib.h"
+#include "support/os.h"
#include <boost/scoped_array.hpp>
#include <cerrno>
+
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
using std::string;
+namespace lyx {
+namespace support {
+
namespace {
inline
char * l_getcwd(char * buffer, size_t size)
{
-#ifdef __EMX
- return ::_getcwd2(buffer, size);
-#elif defined(_WIN32)
+#ifdef _WIN32
GetCurrentDirectory(size, buffer);
return buffer;
#else
// Returns current working directory
-string const lyx::support::getcwd()
+FileName const getcwd()
{
int n = 256; // Assume path is less than 256 chars
char * err;
string result;
if (err)
result = tbuf.get();
- return result;
+ return FileName(os::internal_path(to_utf8(from_filesystem8bit(result))));
}
+
+} // namespace support
+} // namespace lyx