Wed 10 Jun 2015 01:21:18 PM UTC, comment #12:
Thanks for taking care of that Rik, lost track of this patch I had sitting around.
|
Tue 09 Jun 2015 11:18:57 PM UTC, comment #11:
I used the approach in comment #4 and checked in a change on the stable branch (http://hg.savannah.gnu.org/hgweb/octave/rev/c4f436483e49). This will be a part of the 4.0.1 bug fix release.
|
Fri 05 Jun 2015 03:32:23 PM UTC, comment #10:
@Mike: I think it's okay to apply your suggested change from comment #4 to the stable branch.
|
Wed 03 Jun 2015 01:12:30 AM UTC, comment #9:
Thanks for jumping in Philip, I was looking at the changes you had made previously with make_absolute_filename, e.g. http://hg.savannah.gnu.org/hgweb/octave/rev/0cc52d752f99, and thought that would be the right fix here too, but I'm not familiar with the details of all of these various functions.
|
Tue 02 Jun 2015 07:55:24 PM UTC, comment #8:
@comment #5:
AFAICS make_absolute_filename() behaves better on Windows than canonicalize_file_name().
See (earlier posts in) bug #36677
|
Tue 02 Jun 2015 06:33:00 PM UTC, comment #7:
@mtmiller: Confirming that
resolves the issue.
@jwe Thanks; apologies, I didn't spot that option at the time!
|
Tue 02 Jun 2015 04:49:53 PM UTC, comment #6:
Retagging release from 4.0.0-rc4 to 4.0.0.
|
Tue 02 Jun 2015 03:41:13 PM UTC, comment #5:
If the problem is with canonicalize_file_name() then we should report that to gnulib since we use their version in order to get cross-platform compatibility. I suppose in the meantime it would be okay to switch over to Octave's own function of make_absolute_filename().
|
Tue 02 Jun 2015 01:45:12 PM UTC, comment #4:
Ok, that makes sense.
Can you see if the following change works for you instead:
Some work was done recently to make the make_absolute_filename better on Windows paths, and that should probably be used in this situation.
I can delete attachments, but we usually just ignore them.
|
Tue 02 Jun 2015 09:04:04 AM UTC, comment #3:
Hi Mike, thanks for the correction!
I was misled by the fact that strcmp(d,pwd) on line 70 of run.m was giving me 0, when it looked logical in the code that they should be the same, and they did look the same by eye at a quick glance! Sorry, I should have confirmed strcmp further!
The real culprit seems to be the canonicalize_file_name step on line 64, combined with my use of 'Unix-style' file-separators on a windows machine. This fails to correct the file separator just above the directory as you can see below
therefore string comparison fails.
I fixed this on my system by adding a fullfile(d) instruction under line 64, but I suppose someone should really fix this directly in the built-in canonicalize_file_name function eventually!
Thanks for looking at this :)
PS. Is there a way to delete / strikethrough the previous patch?
(file #34148)
|
Tue 02 Jun 2015 02:53:41 AM UTC, comment #2:
Thanks for the bug report and for coming up with a patch.
However, in the Octave language the strcmp function does return true when two strings are equal. Thanks for proposing a patch though! (mtmx on irc)
Do you have a strcmp function that returns 0 when the two arguments are equal? What do you get for the following?
Or if that's not the problem, do you get a different behavior when you use a directory without a space in it, just in case the space is causing problems?
|
Mon 01 Jun 2015 11:26:26 PM UTC, comment #1:
The bug seems to be on line 70 of the existing run.m command.
This uses strcmp within an if statement, in a way that seems to expect this to execute if the output of strcmp is true; however when two strings are equal, strcmp returns 0, therefore the if statement fails instead.
This is trivial to fix, but a patch is included below for consistency.
(file #34146)
|
Mon 01 Jun 2015 10:17:02 PM UTC, original submission:
The 'run' command should enter a directory, run a script, then return to the calling directory. This is what is described in the documentation, and what would be compatible behaviour with the matlab equivalent.
Instead what happens is that it enters a directory, runs the script, and then stays there.
Trivial example:
|