mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix make_dir when filename ends in '/.'
This commit is contained in:
parent
ea15821afe
commit
b06643e9b1
@ -1836,18 +1836,19 @@ make_dir() const {
|
|||||||
if (empty()) {
|
if (empty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Filename path = *this;
|
Filename path;
|
||||||
path.standardize();
|
|
||||||
string dirname;
|
|
||||||
if (_filename[_filename.length() - 1] == '/') {
|
if (_filename[_filename.length() - 1] == '/') {
|
||||||
// The Filename ends in a slash; it represents a directory.
|
// The Filename ends in a slash; it represents a directory.
|
||||||
dirname = path.get_fullpath();
|
path = (*this);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// The Filename does not end in a slash; it represents a file.
|
// The Filename does not end in a slash; it represents a file.
|
||||||
dirname = path.get_dirname();
|
path = get_dirname();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path.standardize();
|
||||||
|
string dirname = path.get_fullpath();
|
||||||
|
|
||||||
// First, make sure everything up to the last path is known. We
|
// First, make sure everything up to the last path is known. We
|
||||||
// don't care too much if any of these fail; maybe they failed
|
// don't care too much if any of these fail; maybe they failed
|
||||||
// because the directory was already there.
|
// because the directory was already there.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user