changeset 21614:9bb39b754ab1

finish previous change to octave_env::set_program_name * oct-env.cc (octave_env::set_program_name): Only perform initialization once.
author John W. Eaton <jwe@octave.org>
date Tue, 12 Apr 2016 10:36:36 -0400
parents e15d3387fc59
children 9ccd64201b4d
files liboctave/system/oct-env.cc
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/system/oct-env.cc	Tue Apr 12 10:10:07 2016 -0400
+++ b/liboctave/system/oct-env.cc	Tue Apr 12 10:36:36 2016 -0400
@@ -261,7 +261,7 @@
 void
 octave_env::do_set_program_name (const std::string& s) const
 {
-  bool initialized = false;
+  static bool initialized = false;
 
   if (! initialized)
     {
@@ -283,6 +283,8 @@
       prog_name = (pos == std::string::npos
                    ? prog_invocation_name
                    : prog_invocation_name.substr (pos+1));
+
+      initialized = true;
     }
 }