[Aptitude-devel] r3028 - in branches/aptitude-0.3/aptitude: . src

Daniel Burrows dburrows@costa.debian.org
Thu, 21 Apr 2005 03:45:45 +0000


Author: dburrows
Date: Thu Apr 21 03:45:42 2005
New Revision: 3028

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/desc_parse.cc
Log:
Fix some off-by-one errors; list paragraphs can be flowed now.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Thu Apr 21 03:45:42 2005
@@ -2,6 +2,13 @@
 
 	* src/desc_parse.cc:
 
+	  Make sure bullet whitespace-stripping includes the space that
+	  separates the bullet from the following text; position the
+	  initial parse location appropriately.  Paragraphs in lists get
+	  flowed now!
+
+	* src/desc_parse.cc:
+
 	  Base the *output* indent level of bulleted text on the number of
 	  bullet levels, not the input indent level.
 

Modified: branches/aptitude-0.3/aptitude/src/desc_parse.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/desc_parse.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/desc_parse.cc	Thu Apr 21 03:45:42 2005
@@ -59,9 +59,7 @@
       string::size_type loc=start;
       unsigned int nspaces;
 
-      if(first)
-	nspaces=indent;
-      else
+      if(!first)
 	{
 	  nspaces=0;
 
@@ -70,12 +68,15 @@
 	      ++loc;
 	      ++nspaces;
 	    }
-	}
 
-      first=false;
-
-      if(nspaces<indent)
-	break;
+	  if(nspaces<indent)
+	    break;
+	}
+      else
+	{
+	  nspaces=indent;
+	  first=false;
+	}
 
       switch(desc[loc])
 	{
@@ -106,11 +107,11 @@
 		string bullet;
 		bullet+=("*+-"[level%3]);
 
-		start=loc2+1;
+		start=loc2+2;
 
 		fragment *item_contents=make_level_fragment(desc,
 							    level+1,
-							    nspaces2+1,
+							    nspaces2+2,
 							    start);
 
 		fragments.push_back(text_fragment(bullet,