mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 10:32:56 +01:00
sources from main repository
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// File_WIN32.cpp
|
||||
//
|
||||
// $Id: //poco/1.3/Foundation/src/File_WIN32.cpp#1 $
|
||||
// $Id: //poco/Main/Foundation/src/File_WIN32.cpp#14 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Filesystem
|
||||
@@ -74,8 +74,10 @@ FileImpl::FileImpl()
|
||||
FileImpl::FileImpl(const std::string& path): _path(path)
|
||||
{
|
||||
std::string::size_type n = _path.size();
|
||||
if (n > 0 && (_path[n - 1] == '\\' || _path[n - 1] == '/'))
|
||||
if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':')))
|
||||
{
|
||||
_path.resize(n - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +95,11 @@ void FileImpl::swapImpl(FileImpl& file)
|
||||
void FileImpl::setPathImpl(const std::string& path)
|
||||
{
|
||||
_path = path;
|
||||
std::string::size_type n = _path.size();
|
||||
if (n > 1 && (_path[n - 1] == '\\' || _path[n - 1] == '/') && !((n == 3 && _path[1]==':')))
|
||||
{
|
||||
_path.resize(n - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -242,7 +249,7 @@ void FileImpl::setSizeImpl(FileSizeImpl size)
|
||||
}
|
||||
|
||||
|
||||
void FileImpl::setWriteableImpl(bool flag)
|
||||
void FileImpl::setWriteableImpl(bool flag)
|
||||
{
|
||||
poco_assert (!_path.empty());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user