projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3af5eef
)
Fix fs::RemoveRelativePathComponents for paths with a leading dot component
author
ShadowNinja
<shadowninja@minetest.net>
Thu, 24 Nov 2016 15:35:48 +0000
(10:35 -0500)
committer
ShadowNinja
<shadowninja@minetest.net>
Thu, 24 Nov 2016 15:38:23 +0000
(10:38 -0500)
Previously, paths like ./worlds would be resolved to /worlds since the
leading dot was considered just as irrelevant as a dot in the middle of
the path.
src/filesys.cpp
patch
|
blob
|
history
diff --git
a/src/filesys.cpp
b/src/filesys.cpp
index b4c52ab793b8bb1bb5331285767b159e7bd917c9..c718a9689fc8bcde8dd522dd91564ad7cdbe9061 100644
(file)
--- a/
src/filesys.cpp
+++ b/
src/filesys.cpp
@@
-631,7
+631,7
@@
std::string RemoveRelativePathComponents(std::string path)
std::string component = path.substr(component_start,
component_end - component_start);
bool remove_this_component = false;
- if(component == "."){
+ if(component == "."
&& component_start != 0
){
remove_this_component = true;
}
else if(component == ".."){