mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-10-03 09:01:33 -04:00
57 lines
1.4 KiB
Plaintext
57 lines
1.4 KiB
Plaintext
$NetBSD: patch-ae,v 1.2 2011/11/26 17:16:53 joerg Exp $
|
|
|
|
--- Colorizer.cc.orig 1999-08-03 19:41:17.000000000 +0000
|
|
+++ Colorizer.cc
|
|
@@ -23,7 +23,8 @@
|
|
|
|
#include <assert.h>
|
|
#include <stdio.h>
|
|
-#include <strstream.h>
|
|
+#include <strstream>
|
|
+#include <cstring>
|
|
|
|
|
|
Colorizer::Colorizer()
|
|
@@ -111,7 +112,7 @@ char* Colorizer::colorize(char *str)
|
|
ListIterator<SearchData*> itr(*m_items_list);
|
|
|
|
// will contain the new string
|
|
- ostrstream newstr;
|
|
+ std::ostrstream newstr;
|
|
|
|
SearchData *current;
|
|
int i = 0;
|
|
@@ -172,7 +173,7 @@ char* Colorizer::colorize(char *str)
|
|
}
|
|
|
|
// write ansi reset str and a newline
|
|
- newstr << ANSI_RESET_STR << endl << ends;
|
|
+ newstr << ANSI_RESET_STR << std::endl << std::ends;
|
|
// return the new string
|
|
return newstr.str();
|
|
}
|
|
@@ -187,12 +188,12 @@ char* Colorizer::colorize(char *str)
|
|
// check if str ends in '\n'
|
|
if (str[strlen(str)] == '\n')
|
|
{
|
|
- newstr << str << ends;
|
|
+ newstr << str << std::ends;
|
|
}
|
|
else
|
|
{
|
|
// doesn't end in '\n'
|
|
- newstr << str << endl << ends;
|
|
+ newstr << str << std::endl << std::ends;
|
|
}
|
|
|
|
// return the new string
|
|
@@ -240,7 +241,7 @@ char* Colorizer::colorize(char *str)
|
|
|
|
// write newline and null
|
|
//newstr << endl << ends;
|
|
- newstr << ends;
|
|
+ newstr << std::ends;
|
|
|
|
|
|
// return the new string
|