[Pinfo-devel] r116 - pinfo/branches/cxx/src

Nathanael Nerode neroden-guest at costa.debian.org
Fri Sep 2 01:43:30 UTC 2005


Author: neroden-guest
Date: 2005-09-02 01:43:30 +0000 (Fri, 02 Sep 2005)
New Revision: 116

Modified:
   pinfo/branches/cxx/src/manual.cxx
Log:
Fix a bug where embedded nulls were getting into 'section'.  Also
add a debugging routine and clean up a little.


Modified: pinfo/branches/cxx/src/manual.cxx
===================================================================
--- pinfo/branches/cxx/src/manual.cxx	2005-09-02 01:08:33 UTC (rev 115)
+++ pinfo/branches/cxx/src/manual.cxx	2005-09-02 01:43:30 UTC (rev 116)
@@ -117,6 +117,13 @@
 /* semaphore for checking if it's a history(left arrow) call */
 int historical = 0;
 
+/* Debugging routine */
+void
+dumplink(manuallink a) {
+	printf("LINK x%sx (x%sx %d) at %d %d (%d)\n\r", (a.name).c_str(),
+		(a.section).c_str(), a.section_mark,
+		a.line, a.col, a.carry);
+}
 
 void
 /* free buffers allocated by current man page */
@@ -241,7 +248,7 @@
 int
 handlemanual(string name)
 {
-	int return_value = 0;
+	int return_value;
 	struct stat statbuf;
 	FILE *id;
 
@@ -537,22 +544,7 @@
 	vector<manuallink>::iterator startlink,
 	vector<manuallink>::iterator endlink)
 {
-	/* Bletchulous.  This breaks so often... */
-	for (vector<manuallink>::iterator ptr = manuallinks.begin();
-	     ptr < manuallinks.end(); ptr++) {
-		printf("%s (%s %d) at %d %d (%d) BEFORE\n\r", (ptr->name).c_str(),
-			(ptr->section).c_str(), ptr->section_mark,
-			ptr->line, ptr->col, ptr->carry);
-	}
-
 	std::sort(startlink, endlink, compare_manuallink);
-
-	for (vector<manuallink>::iterator ptr = manuallinks.begin();
-	     ptr < manuallinks.end(); ptr++) {
-		printf("%s (%s %d) at %d %d (%d) AFTER\n\r", (ptr->name).c_str(),
-			(ptr->section).c_str(), ptr->section_mark,
-			ptr->line, ptr->col, ptr->carry);
-	}
 }
 
 /* initializes hyperlinks in manual */
@@ -708,8 +700,8 @@
 					}
 					else
 					{
-						my_link.section[0] = link[1];
-						my_link.section.resize(1);
+						/* Short manual links */
+						my_link.section = link[1];
 					}
 					my_link.section_mark = 0;
 					my_link.name = (tmp + i);




More information about the Pinfo-devel mailing list