octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: RE: OCTAVE_HOME support in octave_config_info


From: John W. Eaton
Subject: RE: RE: OCTAVE_HOME support in octave_config_info
Date: Wed, 7 Feb 2007 03:59:50 -0500

On  7-Feb-2007, address@hidden wrote:

| > I checked in the attached patch.
| 
| Why don't you also do substitution for \"prefix\"? I don't see another way to 
know the
| top-level installation directory (and the startup script I use in the binary 
package relies
| on it).

OK, I fixed it to also substitute prefix, exec_prefix, and infofile
(though maybe infofile should just be the name of the file itself, and
any code that needs to use that should concat it with infodir).

Currently there is also no substitution for MKOCTFILE_INCFLAGS,
MKOCTFILE_LFLAGS, or RLD_FLAG because I don't see how to do the
substitution properly, so I think the portions of these variables that
contain directory names need to have the substitution done on the
directory name before those names are combind with the option
characters, etc.

I also checked in the following change to avoid possibly bad
substitutions.

jwe

src/ChangeLog:

2007-02-07  John W. Eaton  <address@hidden>

        * defaults.cc (subst_octave_home):
        Only substitute at beginning of string.

Index: src/defaults.cc
===================================================================
RCS file: /cvs/octave/src/defaults.cc,v
retrieving revision 1.64
diff -u -u -r1.64 defaults.cc
--- src/defaults.cc     7 Feb 2007 07:22:03 -0000       1.64
+++ src/defaults.cc     7 Feb 2007 08:53:52 -0000
@@ -108,12 +108,9 @@
   if (Voctave_home != prefix)
     {
       octave_idx_type len = prefix.length ();
-      size_t start = 0;
-      while ((start = retval.find (prefix, start)) != NPOS)
-       {
-         retval.replace (start, len, Voctave_home);
-         start += len;
-       }
+
+      if (s.substr (0, len) == prefix)
+       retval.replace (0, len, Voctave_home);
     }
 
   if (file_ops::dir_sep_char != '/')

reply via email to

[Prev in Thread] Current Thread [Next in Thread]