bugGNU Octave - Bugs: bug #39288, strjoin ignores trailing spaces in...

 
 

bug #39288: strjoin ignores trailing spaces in prefixstr

Submitted by:  None
Submitted on:  Wed 19 Jun 2013 01:45:25 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NoneAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.2
Operating System: GNU/Linux

Add a New Comment (Rich MarkupRich 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)

Mon 24 Jun 2013 12:24:38 AM UTC, comment #8:

strjoin() has been removed from the strings package. The version included in Octave core works correctly. I'm closing this report.

Ben Abbott <bpabbott>
Project Member
Sun 23 Jun 2013 04:00:44 PM UTC, comment #7:

I searched for that error message (appears in pt-mat.cc) and through the log (for "pt-mat.cc"), and I believe it is this bug fix that accounts for your current error.

http://hg.savannah.gnu.org/hgweb/octave/rev/797ac81586d1

author Julien Bect <julien.bect@supelec.fr>
date Tue, 26 Feb 2013 12:06:45 +0100 (3 months ago)

This explains why "sprintf()" was being used in the strjoin.m routine before this recent optimization:

https://savannah.gnu.org/patch/?8066

Unless you want to rebuild to the latest code which includes the above fix (there was a scheduled release coming up, but I'm not sure if that will be met, so I don't think it pays to wait a week or two), you might be able to work from the less efficient version of strjoin() prior to the patch, which would be this one:

http://hg.savannah.gnu.org/hgweb/octave/file/424463a80134/scripts/strings/strjoin.m

(Again, use the "raw" button to download the file.)

Whether the above is the same script file that originally caused you errors, I'm not sure.

Dan Sebald <sebald>
Sun 23 Jun 2013 12:46:40 PM UTC, comment #6:

Dan, the size of the array is correct:

I did some debugging right before line 80:

As noted in the original submission, I'm using Octave 3.6.2.

Anonymous
Sun 23 Jun 2013 04:54:26 AM UTC, comment #5:

I would think so. Send to maintainers list (which now also handles packages). C.D. usually handles the package changes.

Dan Sebald <sebald>
Sun 23 Jun 2013 01:18:18 AM UTC, comment #4:

Dan, the function strjoin() wasn't present in Octave core for 3.6.2.

The error being reported is for the strings package. Should strjoin be removed from the package?

http://octave.sourceforge.net/strings/overview.html

Ben Abbott <bpabbott>
Project Member
Sat 22 Jun 2013 04:42:39 PM UTC, comment #3:

Your examples works for me on my system:

Are you using the latest (or at least a very recent) version of Octave? The error message you are seeing is indicating that {"Octave", "Scilab", "Lush", "Yorick"} is a 2x4 matrix. But I'm seeing it as a 1x4 array.

Also, I don't see how the size of the delimiter matrix at that point in the function could be 1x1. There is an if/elseif/else statement for which at least one of those must happen. It's not the second case, and the other two cases would increase the size of the delimiter cell string which it is converted to.

All I can think of is that you might have an old Octave version that has buggy cell string behavior.

This may have lead to uncovering a problem, though. The command strjoin ({}, "*") produces an odd result. I will note this here:

https://savannah.gnu.org/patch/?8066

Dan Sebald <sebald>
Sat 22 Jun 2013 02:31:03 PM UTC, comment #2:

Firstly, I noticed that this version of strjoin uses a completely different syntax than what the function reference says: it takes the strings to join in the first parameter as a cell array and the delimiter as the second. But it's probably good to change that, since MATLAB's strjoin function does the same thing.

Secondly, it throws a dimension mismatch error if I pass more than one string in the cell array:

Anonymous
Fri 21 Jun 2013 06:37:05 PM UTC, comment #1:

There have been some recent changes to strjoin.m:

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

This is a change to the script file only, so should be easy to test. Could you please get the latest version of the script file:

http://hg.savannah.gnu.org/hgweb/octave/file/519343308ab1/scripts/strings/strjoin.m

(go to the web location and click on the left column menu item that indicates "raw") and let us know if that solves the problem?

Dan Sebald <sebald>
Wed 19 Jun 2013 01:45:25 PM UTC, original submission:

strjoin (from the strings package; reference) ignores trailing spaces in the first parameter, prefixstr:

Packages: octave 3.6.2-5+deb7u1 and octave-strings 1.1.0-1 amd64 from the Debian Wheezy repository.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bpabbott (Posted a comment)
  • -unavailable- added by sebald (Posted a comment)
  •  

    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):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 24 Jun 2013 12:24:38 AM UTCbpabbottOpen/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup