Skip to content

Commit 33a06ec

Browse files
committed
Do not remove trailing path separator if path size is 1
1 parent 072339c commit 33a06ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/io/IOUtil.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ namespace kanzi
109109
// Note: old version of Windows/Visual Studio require a trailing '/' to stat network folders !
110110
// In this scenario, "//PC/share" does not work but "//PC/share/" does
111111
#ifndef _MSC_VER
112-
if (target[target.size() - 1] == PATH_SEPARATOR)
112+
if ((target.size() > 1) && (target[target.size() - 1] == PATH_SEPARATOR))
113113
target.resize(target.size() - 1);
114114
#endif
115115

0 commit comments

Comments
 (0)