summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceGroupCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmSourceGroupCommand.cxx')
-rw-r--r--Source/cmSourceGroupCommand.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx
index 8c9b63c..c3df313 100644
--- a/Source/cmSourceGroupCommand.cxx
+++ b/Source/cmSourceGroupCommand.cxx
@@ -101,9 +101,13 @@ bool addFilesToItsSourceGroups(const std::string& root,
tokenizedPath = tokenizePath(sgFilesPath);
}
- if (tokenizedPath.size() > 1) {
+ if (!tokenizedPath.empty()) {
tokenizedPath.pop_back();
+ if (tokenizedPath.empty()) {
+ tokenizedPath.push_back("");
+ }
+
sg = makefile.GetOrCreateSourceGroup(tokenizedPath);
if (!sg) {