From bug-octave-request at bevo dot che dot wisc dot edu Wed Jan 22 02:55:15 2003 Subject: Re: looping over struct never stops From: Etienne Grossmann To: "John W. Eaton" Cc: Etienne Grossmann , bug-octave@bevo.che.wisc.edu, Etienne Grossmann Date: Wed, 22 Jan 2003 08:59:15 +0000 Hello, just to say that the patch works here. Thank you, Etienne On Tue, Jan 21, 2003 at 10:19:23AM -0600, John W. Eaton wrote: # On 21-Jan-2003, Etienne Grossmann wrote: [snip] # | Bug report for Octave 2.1.43 configured for i686-pc-linux-gnu # | # | Description: # | ----------- # | # | The "for [value, key] = my_struct" loop seems to be broken. # | # | Repeat-By: # | --------- # | # | a = struct ("x",2); # | for [v,k] = a, printf(" %s -> %f\n",k,v); end # | [snip] # Please try the following patch. # # Thanks, # # jwe # # # src/ChangeLog: # # 2003-01-21 John W. Eaton # # * pt-loop.cc (tree_complex_for_command::eval): Fix typo. # # # Index: pt-loop.cc # =================================================================== # RCS file: /usr/local/cvsroot/octave/src/pt-loop.cc,v # retrieving revision 1.21 # diff -u -r1.21 pt-loop.cc # --- pt-loop.cc 6 Dec 2002 21:29:18 -0000 1.21 # +++ pt-loop.cc 21 Jan 2003 16:18:06 -0000 # at @ -486,7 +486,7 @@ # # Octave_map tmp_val (rhs.map_value ()); # # - for (Octave_map::iterator q = tmp_val.begin (); q != tmp_val.end (); p++) # + for (Octave_map::iterator q = tmp_val.begin (); q != tmp_val.end (); q++) # { # octave_value key = tmp_val.key (q); # # # -- Etienne Grossmann ------ http://www.isr.ist.utl.pt/~etienne ------------------------------------------------------------- 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 -------------------------------------------------------------