mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Implement os::current_root for native Win32 builds.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9425 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ea2982a143
commit
cbd48ca779
@ -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.
|
||||
|
@ -20,8 +20,14 @@
|
||||
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
|
||||
#if defined(__CYGWIN__) || defined(__CYGWIN32__)
|
||||
# include <sys/cygwin.h>
|
||||
|
||||
#elif defined(_WIN32)
|
||||
# include <direct.h> // _getdrive
|
||||
#endif
|
||||
|
||||
using namespace lyx::support;
|
||||
using std::endl;
|
||||
using std::string;
|
||||
@ -89,7 +95,14 @@ void warn(string const & mesg)
|
||||
|
||||
string current_root()
|
||||
{
|
||||
return "/";
|
||||
#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
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user