bugGNU Octave - Bugs: bug #41978, hgload not finding correct *.ofig...

 
 

bug #41978: hgload not finding correct *.ofig file

Submitted by:  Muhali <muhali>
Submitted on:  Thu 27 Mar 2014 02:30:30 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 28 Mar 2014 05:02:38 PM UTC, comment #8:

works for me now. Thanks.

Muhali <muhali>
Fri 28 Mar 2014 04:07:10 PM UTC, comment #7:

@Rik: Thanks. I'm sorry, I should have updated before modifying. Nevertheless, I'm not sure that file_in_loadpath() is required anymore (of course, my patch was wrong in any case).

Massimiliano Fasi <mfasi>
Fri 28 Mar 2014 03:52:09 PM UTC, comment #6:

I checked in a changeset that should fix this (http://hg.savannah.gnu.org/hgweb/octave/rev/348f67886dc4). I'm marking the bug as "Ready For Test".

@Massimiliano, I based the change on the most current Mercurial sources rather than your patch because the sources had already shifted from using exist() to file_in_loadpath() to correct a different problem that Muhali found.

Rik <rik5>
Project Administrator
Fri 28 Mar 2014 12:48:36 PM UTC, comment #5:

I have submitted a patch that should fix the bug. It does not warn the user if he/she is using an extension that differs from ".ofig", but does not try to open file without extension. Thank you!

(file #31064)

Massimiliano Fasi <mfasi>
Fri 28 Mar 2014 12:32:11 PM UTC, comment #4:

Hi,

first of all, I noticed that I was using the version I submitted, that turned out to be slightly different from the one that was committed. Indeed, I checked the file existence using a not-so-Octave way

that did not suffer from this bug. I think that the new version is better, but I am a little bit suspicious about the fact that the existence of the file is checked twice in two nested if. I think that these two solutions can be merged and I'm trying to do it, I will update this thread soon (I hope).

Massimiliano Fasi <mfasi>
Fri 28 Mar 2014 09:33:56 AM UTC, comment #3:

when you do

you will see the error. BTW, did you use Rik's changeset?

Muhali <muhali>
Fri 28 Mar 2014 09:24:23 AM UTC, comment #2:

Hi all,

I am insterested in this bug as I have written the two buggy functions. Nevertheless, I haven't been able to reproduce the problem. I did

and it worked. So I tried

and it worked. Then I removed the file foo.ofig and I got

that is what I would have expected. So, I put a file foo.m in the current directory, getting again

that seems ok to me. Then I tried to plot, save and load again and it worked as in the previous case. So I haven't tested the right (faulty) case, or the behaviour I expect isn't the right one. Can you please help me understand the problem? Thanks!

Massimiliano Fasi <mfasi>
Fri 28 Mar 2014 12:21:06 AM UTC, comment #1:

This was partially fixed in changeset

http://hg.savannah.gnu.org/hgweb/octave/rev/70d9db29db6f

But as Muhali noted on the mailing list (and I can confirm), there is still a problem if a file named "foo" exists in the same directory as "foo.ofig".

Based on the description of the function, it should probably add the ".ofig" extension unconditionally if the given string argument has no file extension.

Mike Miller <mtmiller>
Project Administrator
Thu 27 Mar 2014 02:30:30 PM UTC, original submission:

If there is a file 'foo.ofig' plus a file 'foo.m' in the current directory (or anywhere in the load path), the command

hgload("foo")

does not work. In this part of the hgload function

the check is incomplete, as it finds foo.m.

Muhali <muhali>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #31064:  hgload.patch added by mfasi (1017B - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by mfasi (Posted a comment)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by muhali (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 28 Mar 2014 07:00:01 PM UTCrik5StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Fri 28 Mar 2014 03:52:09 PM UTCrik5StatusConfirmed=>Ready For Test
    Fri 28 Mar 2014 12:48:36 PM UTCmfasiAttached File-=>Added hgload.patch, #31064
    Fri 28 Mar 2014 12:21:06 AM UTCmtmillerCategoryNone=>Octave Function
      Item GroupNone=>Incorrect Result
      StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1