From bug-octave-request at bevo dot che dot wisc dot edu Fri Dec 15 19:09:03 2000 Subject: Unidentified subject! From: "John W. Eaton" To: "Matthew W. Roberts" Cc: bug-octave at bevo dot che dot wisc dot edu Date: Fri, 15 Dec 2000 19:08:05 -0600 On 11-May-2000, Matthew W. Roberts wrote: | To: bug-octave at bevo dot che dot wisc dot edu | Cc: matt | Subject: findstr() handles empty string incorrectly | | Bug report for Octave 2.1.30 configured for %OCTAVE_CONF_CANONICAL_HOST_TYPE% | | Description: | ----------- | | When using findstr() on an empty string the vector [ 1, 2] is returned. | IMO, an empty vector should be returned. | | | Repeat-By: | --------- | | findstr( "", "d") | | Fix: | --- | | diff below. findstr.m is my fix, scripts/strings/findstr.m is | the original | | *** findstr.m Thu May 11 15:29:44 2000 | --- scripts/strings/findstr.m Fri Jan 28 16:53:19 2000 | *************** | *** 60,71 **** | | l_t = length (t); | | - # Check for empty string | - if( l_t < 1) | - v = []; | - return; | - endif | - | ind = 1 : l_t; | limit = length (s) - l_t + 1; | v = zeros (1, limit); | --- 60,65 ---- Sorry for the long delay. I made this change in the CVS sources. Thanks, jwe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------