summaryrefslogtreecommitdiffstats
path: root/Directory.cxx
diff options
context:
space:
mode:
authorKWSys Upstream <kwrobot@kitware.com>2019-02-12 13:34:34 (GMT)
committerBrad King <brad.king@kitware.com>2019-02-12 13:35:11 (GMT)
commitf3999a21c85e6caf19feef7c90afce3969d9102a (patch)
treedaee4659850a9609bfc14f05fb90f718315941fb /Directory.cxx
parent8372c054729984a76e3e619b4c28865006d905d0 (diff)
downloadCMake-f3999a21c85e6caf19feef7c90afce3969d9102a.zip
CMake-f3999a21c85e6caf19feef7c90afce3969d9102a.tar.gz
CMake-f3999a21c85e6caf19feef7c90afce3969d9102a.tar.bz2
KWSys 2019-02-12 (44676809)
Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 4467680959f82b755462a8530ef5d0dbd928d2d4 (master). Upstream Shortlog ----------------- Albert Astals Cid (1): 7d50c26d Delete some default constructors and assignment operators Artur Ryt (1): 01089e4c Prefer back/data over dereferencing rbegin/begin iterator
Diffstat (limited to 'Directory.cxx')
-rw-r--r--Directory.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Directory.cxx b/Directory.cxx
index 31b1c15..59530a4 100644
--- a/Directory.cxx
+++ b/Directory.cxx
@@ -102,7 +102,7 @@ bool Directory::Load(const std::string& name)
# endif
char* buf;
size_t n = name.size();
- if (*name.rbegin() == '/' || *name.rbegin() == '\\') {
+ if (name.back() == '/' || name.back() == '\\') {
buf = new char[n + 1 + 1];
sprintf(buf, "%s*", name.c_str());
} else {
@@ -144,7 +144,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name)
# endif
char* buf;
size_t n = name.size();
- if (*name.rbegin() == '/') {
+ if (name.back() == '/') {
buf = new char[n + 1 + 1];
sprintf(buf, "%s*", name.c_str());
} else {