[changeset] Re: bug in gunzip / strange line numbers in error message / keyboard weirdness
Thorsten Meyer
thorsten.meyier at gmx.de
Tue Nov 4 16:17:36 CST 2008
Søren Hauberg wrote:
>> gzfile =
>>
>> {
>> [1,1] = /tmp/oct-rZOZFQ/oct-OLjAWz.gz
>> }
>>
>> octave:7> gunzip(gzfile)
>> error: `ext' undefined near line 145 column 30
>> error: evaluating argument list element number 1
>> error: evaluating argument list element number 1
>> error: called from:
>> error: /home/thorsten/hg/octave/scripts/miscellaneous/unpack.m at line 145, column 12
>> error: /home/thorsten/hg/octave/scripts/miscellaneous/gunzip.m at line 47, column 5
> I quick look at 'unpack.m' brings the following to my attention:
>
> if (ischar (file))
> if (isdir (file))
> if (isempty (filetype))
> error ("unpack: filetype must be given for a directory");
> elseif (! any (strcmpi (filetype, "gunzip")))
> error ("unpack: filetype must be gunzip for a directory");
> endif
> else
> [pathstr, name, ext] = fileparts (file);
>
>
> So, if 'file' is a directory, we don't really do anything with it. I
> some cases we raise errors, but sometimes we just do nothing. I'm
> guessing this is the source of the problem.
Thanks for the hint. I found the bug a bit further down the same if statement: unpack handles
cell arrays of strings by recursively calling unpack for the individual strings. After that it does
not return but enters the part of the function which is meant for strings only.
Enclosed is a patch that solves this problem.
regards
Thorsten
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unpack.patch
Type: text/x-patch
Size: 1163 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/bug-octave/attachments/20081104/0618c23b/attachment.bin
More information about the Bug-octave
mailing list