diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-09-03 15:30:00 (GMT) |
---|---|---|
committer | vvs31415 <vvs31415@users.noreply.github.com> | 2020-09-03 15:36:54 (GMT) |
commit | 1380b4376408a1ec97bc23f521c067a83dc58680 (patch) | |
tree | e51d8351d2b61d08a6798fa3a71578c75fba458d /Source/cmGetPropertyCommand.cxx | |
parent | ca5babfd7a1da8e32f927ad086fdd91c2b09853b (diff) | |
download | CMake-1380b4376408a1ec97bc23f521c067a83dc58680.zip CMake-1380b4376408a1ec97bc23f521c067a83dc58680.tar.gz CMake-1380b4376408a1ec97bc23f521c067a83dc58680.tar.bz2 |
Refactor: Use cmToCStr()
Diffstat (limited to 'Source/cmGetPropertyCommand.cxx')
-rw-r--r-- | Source/cmGetPropertyCommand.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 7f60f85..3a5b39d 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -281,8 +281,7 @@ bool HandleGlobalMode(cmExecutionStatus& status, const std::string& name, // Get the property. cmake* cm = status.GetMakefile().GetCMakeInstance(); cmProp p = cm->GetState()->GetGlobalProperty(propertyName); - return StoreResult(infoType, status.GetMakefile(), variable, - p ? p->c_str() : nullptr); + return StoreResult(infoType, status.GetMakefile(), variable, cmToCStr(p)); } bool HandleDirectoryMode(cmExecutionStatus& status, const std::string& name, @@ -329,8 +328,7 @@ bool HandleDirectoryMode(cmExecutionStatus& status, const std::string& name, // Get the property. cmProp p = mf->GetProperty(propertyName); - return StoreResult(infoType, status.GetMakefile(), variable, - p ? p->c_str() : nullptr); + return StoreResult(infoType, status.GetMakefile(), variable, cmToCStr(p)); } bool HandleTargetMode(cmExecutionStatus& status, const std::string& name, @@ -449,8 +447,7 @@ bool HandleCacheMode(cmExecutionStatus& status, const std::string& name, value = status.GetMakefile().GetState()->GetCacheEntryProperty( name, propertyName); } - StoreResult(infoType, status.GetMakefile(), variable, - value ? value->c_str() : nullptr); + StoreResult(infoType, status.GetMakefile(), variable, cmToCStr(value)); return true; } |