octave-maintainers
[Top][All Lists]
Advanced

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

strings assignment fix


From: Jaroslav Hajek
Subject: strings assignment fix
Date: Tue, 30 Sep 2008 09:24:07 +0200

hello,

using current tip, the following character assignment does not work:
a = ["aa";"aa"]; b = "aa"; a(1,1:0) = b(1:0);
and as a consequence, `split' does not work with consecutive separators.

The problem is triggered by octave_char_matrix_str::assign which
redefines the inherited method, and pre-converts empty strings (1D
vectors) to 0x0 matrices. Probably some historical hack that ceased to
work due to null assignments not being recognized in liboctave.

This override seems no longer necessary; hence the attached patch that
removes the member function, and also adds tests for consecutive and
leading/trailing separators to split.m.

regards

-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

Attachment: str-assign-fix.diff
Description: Text Data


reply via email to

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