octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #44750] Incorrect output in textscan/strread w


From: Guillaume
Subject: [Octave-bug-tracker] [bug #44750] Incorrect output in textscan/strread with trailing delimiter
Date: Mon, 06 Apr 2015 18:23:02 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0

URL:
  <http://savannah.gnu.org/bugs/?44750>

                 Summary: Incorrect output in textscan/strread with trailing
delimiter
                 Project: GNU Octave
            Submitted by: gyom
            Submitted on: Mon 06 Apr 2015 06:23:01 PM GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Guillaume
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:


textscan('/home/foo/','%s','delimiter','/','MultipleDelimsAsOne',1)


This command returns {'home'} instead of {'home','foo'}. The correct output is
returned when the trailing delimiter is removed: '/home/foo'.

I could track down the problem in strread>split_by:


## In case of trailing delimiter, strip stray last empty word
  if (! isempty (out) && any (sep == text(end)))
    out(end) = [];
  endif


but I am not sure of what the right fix would be without breaking other
situations.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44750>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]