changeset 21284:1bbd799ac7c7 stable

Invoke correct version of octave-cli from main driver program * main.in.cc (main): Refactor construction of binary filenames, ensure versioned octave-cli binary is called for --no-gui-libs.
author Mike Miller <mtmiller@octave.org>
date Wed, 17 Feb 2016 01:21:19 -0800
parents 8990b8c4f00a
children 2c93596507fe 596e19e7e571
files src/main.in.cc
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.in.cc	Sat Dec 12 21:34:06 2015 -0500
+++ b/src/main.in.cc	Wed Feb 17 01:21:19 2016 -0800
@@ -432,16 +432,18 @@
 
   std::string octave_bindir = get_octave_bindir ();
   std::string octave_archlibdir = get_octave_archlibdir ();
+  std::string octave_cli
+    = octave_bindir + dir_sep_char + "octave-cli-" OCTAVE_VERSION;
+  std::string octave_gui = octave_archlibdir + dir_sep_char + "octave-gui";
 
 #if defined (HAVE_OCTAVE_GUI)
   // The Octave version number is already embedded in the
   // octave_archlibdir directory name so we don't need to append it to
   // the octave-gui file name.
 
-  std::string file = octave_archlibdir + dir_sep_char + "octave-gui";
+  std::string file = octave_gui;
 #else
-  std::string file
-    = octave_bindir + dir_sep_char + "octave-cli-" OCTAVE_VERSION;
+  std::string file = octave_cli;
 #endif
 
   char **new_argv = new char * [argc + 1];
@@ -462,7 +464,7 @@
 
           start_gui = false;
           gui_libs = false;
-          file = octave_bindir + dir_sep_char + "octave-cli";
+          file = octave_cli;
         }
       else if (! strcmp (argv[i], "--no-gui"))
         {
@@ -498,7 +500,7 @@
           start_gui = false;
           gui_libs = false;
 
-          file = octave_bindir + dir_sep_char + "octave-cli-" OCTAVE_VERSION;
+          file = octave_cli;
 
           if (warn_display)
             {