[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #35999] strread error on empty string and rela
From: |
Philip Nienhuis |
Subject: |
[Octave-bug-tracker] [bug #35999] strread error on empty string and related textread warning on empty file |
Date: |
Sun, 25 Mar 2012 21:28:48 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6 |
Follow-up Comment #2, bug #35999 (project octave):
(?guru? now if only that were true. But thx I'm flattered :-) )
Indeed, easy fix. Changeset attached
Why anyone would want to read from an empty string is beyond me, but I can
imagine scripts feeding empty strings to strread in some corner cases. IMO in
that situation the most sensible action would be to silently return empty
output args, so that the calling scripts wouldn't be interrupted.
If users prefer errors in such cases, they'd better include checks for empty
strings in the calling scripts before the call to strread.
I've not checked output arg type, you just get the requested number of empty
args as [].
BTW textread has just been finally fixed today for some other reason, along
the way I've also fixed this very bug. See
https://savannah.gnu.org/patch/?7748 (I'm awaiting verification before I push
that)
BTW even if that textread fix hadn't been made, strread would now catch it
anyway.
Can one of the devs please verify my attached patch, please?
(file #25467)
_______________________________________________________
Additional Item Attachment:
File name: strread_emptystr.patch Size:0 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?35999>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/