From bfb6d68447eda7a547d525e5da3aa510ce8ab08d Mon Sep 17 00:00:00 2001 From: Benjamin Piwowarski Date: Fri, 21 Mar 2014 18:38:09 +0100 Subject: [PATCH] Avoids const_cast in configure_command by using mutable --- src/support/Package.cpp | 3 +-- src/support/Package.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/support/Package.cpp b/src/support/Package.cpp index e8bef81d3c..442351a8a2 100644 --- a/src/support/Package.cpp +++ b/src/support/Package.cpp @@ -174,9 +174,8 @@ Package::Package(string const & command_line_arg0, std::string const & Package::configure_command() const { if (configure_command_.empty()) { - std::string &command = const_cast(configure_command_); FileName const configure_script(addName(system_support().absFileName(), "configure.py")); - command = os::python() + ' ' + + configure_command_ = os::python() + ' ' + quoteName(configure_script.toFilesystemEncoding()) + with_version_suffix() + " --binary-dir=" + quoteName(FileName(binary_dir().absFileName()).toFilesystemEncoding()); diff --git a/src/support/Package.h b/src/support/Package.h index 08386b4b9a..0349cd541a 100644 --- a/src/support/Package.h +++ b/src/support/Package.h @@ -157,7 +157,7 @@ private: mutable FileName document_dir_; mutable FileName temp_dir_; FileName system_temp_dir_; - std::string configure_command_; + mutable std::string configure_command_; bool explicit_user_support_dir_; };