[PATCH] Fix iterator bug in choose.cc

Igor Pechtchanski pechtcha@cs.nyu.edu
Thu Mar 13 20:47:00 GMT 2003


I noticed there is a bug in an iterator in choose.cc that causes "All" to
be printed twice in the list of categories in setup.log.full.  The
attached patch fixes that.  Note that, like the original, the patch will
not work if a package is not in any category (but that shouldn't happen
anyway, right?).
	Igor
==============================================================================
2003-03-13  Igor Pechtchanski <pechtcha@cs.nyu.edu>

	* choose.cc (ChooserPage::OnNext): Fix iterator bug.

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune
-------------- next part --------------
Index: choose.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/choose.cc,v
retrieving revision 2.112
diff -u -p -r2.112 choose.cc
--- choose.cc	10 Mar 2003 06:22:16 -0000	2.112
+++ choose.cc	13 Mar 2003 20:10:19 -0000
@@ -604,8 +604,8 @@ ChooserPage::OnNext ()
 	  set <String, String::caseless>::const_iterator i 
 	    = pkg.categories.begin ();
 	  String all_categories = *i;
-	  while (i != pkg.categories.end ())
-	    all_categories += String (", ") + *(i++);
+	  while (++i != pkg.categories.end ())
+	    all_categories += String (", ") + (*i);
 
 	  log (LOG_BABBLE) << "     categories=" << all_categories << endLog;
 	}


More information about the Cygwin-apps mailing list