Implement os::current_root for native Win32 builds.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@9426 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2005-01-04 17:50:28 +00:00
parent 545d63577f
commit f8ce4b80b1
2 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,7 @@
2005-01-04 Angus Leeming <leeming@lyx.org>
* os_win32.C (current_root): use _getdrive on Win32.
* FileInfo.C (FileInfo, newFile): strip the trailing '/' from
the stored file name as it breaks Window's version of stat().
(isLink): protect the code with #ifdef S_ISLNK.

View File

@ -15,6 +15,9 @@
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
#include <sys/cygwin.h>
#include <cstdlib>
#elif defined(_WIN32)
# include <direct.h> // _getdrive
#endif
@ -82,7 +85,14 @@ void os::warn(string mesg)
string os::current_root()
{
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
return string("/");
#else
// _getdrive returns the current drive (1=A, 2=B, and so on).
char const drive = ::_getdrive() + 'A' - 1;
return string(1, drive) + ":/";
#endif
}