Skip to content

Commit d64a9c7

Browse files
committed
exchndl: Fix path truncation.
Thanks to @asmwarrior for the diagnosis/fix. Fixes #71
1 parent 9165391 commit d64a9c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/exchndl/exchndl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ Setup(void)
192192
path.resize(nSize);
193193
auto found = std::find(path.crbegin(), path.crend(), '.');
194194
if (found != path.crend()) {
195-
path.resize(found - path.crbegin());
195+
// Reverse iterators here, hence crend() points to string start
196+
path.resize(path.crend() - found - 1);
196197
}
197198
path.push_back('.');
198199
path.push_back('R');

0 commit comments

Comments
 (0)