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

Nathanael Nerode neroden-guest at costa.debian.org
Fri Sep 2 08:25:36 UTC 2005


Author: neroden-guest
Date: 2005-09-02 08:25:35 +0000 (Fri, 02 Sep 2005)
New Revision: 144

Modified:
   pinfo/branches/cxx/src/manual.cxx
Log:
And the interface.


Modified: pinfo/branches/cxx/src/manual.cxx
===================================================================
--- pinfo/branches/cxx/src/manual.cxx	2005-09-02 08:23:50 UTC (rev 143)
+++ pinfo/branches/cxx/src/manual.cxx	2005-09-02 08:25:35 UTC (rev 144)
@@ -152,27 +152,25 @@
 
 /* initialize history variables for manual pages.  */
 void
-set_initial_history(const char *name)
+set_initial_history(string name)
 {
-	string name2 = name;
-
 	/* filter trailing spaces */
 	string::size_type len;
-	for (len = name2.length(); (len > 0) && isspace(name2[len - 1]); len--);
-	name2.resize(len);
+	for (len = name.length(); (len > 0) && isspace(name[len - 1]); len--);
+	name.resize(len);
 
 	/* find the beginning of the last token */
 	string::size_type i;
-	for (i = len - 1; (i > 0) && !isspace(name2[i]); i--);
+	for (i = len - 1; (i > 0) && !isspace(name[i]); i--);
 
 	/* if we've found space, then we move to the first nonspace character */
-	if ( (i > 0) || (i == 0 && isspace(name2[i])) ) {
+	if ( (i > 0) || (i == 0 && isspace(name[i])) ) {
 		i++;
 	}
 
 	manhistory my_hist;
 	/* filename->name */
-	my_hist.name = name2.substr(i);
+	my_hist.name = name.substr(i);
 	/* section unknown */
 	my_hist.sect = "";
 	/* selected unknown */
@@ -322,7 +320,7 @@
 
 	init_curses();
 
-	set_initial_history(name.c_str());
+	set_initial_history(name);
 	/* load manual to memory */
 	loadmanual(id);
 	fclose(id);




More information about the Pinfo-devel mailing list