1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

- Fix build on -current

PR:		ports/62432
Submitted by:	Ports Fury
This commit is contained in:
Kirill Ponomarev 2004-02-06 14:08:52 +00:00
parent 05079e4428
commit d7896d335f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=100145
5 changed files with 107 additions and 29 deletions

View File

@ -17,16 +17,10 @@ COMMENT= A colour-able replacement for tail(1)
USE_GETOPT_LONG= yes USE_GETOPT_LONG= yes
GNU_CONFIGURE= yes GNU_CONFIGURE= yes
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 502000
BROKEN= "Does not compile"
.endif
post-install: post-install:
.if !defined(NOPORTDOCS) .if !defined(NOPORTDOCS)
@${MKDIR} ${EXAMPLESDIR} @${MKDIR} ${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/example-conf/conf* ${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/example-conf/conf* ${EXAMPLESDIR}
.endif .endif
.include <bsd.port.post.mk> .include <bsd.port.mk>

View File

@ -1,14 +1,56 @@
$FreeBSD$ $FreeBSD$
--- Colorizer.cc.orig Tue Nov 26 01:12:35 2002 --- Colorizer.cc.orig Wed Aug 4 04:41:17 1999
+++ Colorizer.cc Tue Nov 26 01:12:49 2002 +++ Colorizer.cc Thu Feb 5 19:49:47 2004
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
#include <assert.h> #include <assert.h>
#include <stdio.h> #include <stdio.h>
-#include <strstream.h> -#include <strstream.h>
+#include <iostream.h> +#include <strstream>
Colorizer::Colorizer() Colorizer::Colorizer()
@@ -111,7 +111,7 @@
ListIterator<SearchData*> itr(*m_items_list);
// will contain the new string
- ostrstream newstr;
+ std::ostrstream newstr;
SearchData *current;
int i = 0;
@@ -172,7 +172,7 @@
}
// 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 +187,12 @@
// 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 +240,7 @@
// write newline and null
//newstr << endl << ends;
- newstr << ends;
+ newstr << std::ends;
// return the new string

View File

@ -1,20 +1,20 @@
--- OptionsParser.cc.orig Thu Aug 5 01:23:39 1999 --- OptionsParser.cc.orig Thu Aug 5 08:23:39 1999
+++ OptionsParser.cc Tue Jan 28 13:11:52 2003 +++ OptionsParser.cc Thu Feb 5 19:49:47 2004
@@ -136,6 +136,8 @@ @@ -18,7 +18,7 @@
{ */
if (optarg[pos] == ',')
{
+ filename.put('\0');
+
// found seperator
// set filename in options class
o->cfg_filenames[o->nr_cfg_files] = filename.str();
@@ -152,6 +154,8 @@
if (optarg[pos] == '\0') #include <iostream.h>
{ -#include <strstream.h>
+ filename.put('\0'); +#include <strstream>
+ #include <string.h>
// found end of string #include <stdio.h>
// set filename in options class #include <stdlib.h>
o->cfg_filenames[o->nr_cfg_files] = filename.str(); @@ -130,7 +130,7 @@
int loop = 1;
while (loop)
{
- ostrstream filename;
+ std::ostrstream filename;
while (1)
{

View File

@ -0,0 +1,21 @@
--- TailFile.cc.orig Thu Aug 5 08:09:38 1999
+++ TailFile.cc Thu Feb 5 19:49:47 2004
@@ -375,7 +375,7 @@
// check if there isn't a follow buffer
if (m_follow_buffer == NULL)
{
- m_follow_buffer = new ostrstream();
+ m_follow_buffer = new std::ostrstream();
}
// make buffer
@@ -417,6 +417,9 @@
int ch = fgetc(m_file);
// add the character to the string
+ if (ch == EOF)
+ clearerr(m_file); // required by POSIX and ANSI
+ else
m_follow_buffer->put(ch);
// check if return

View File

@ -0,0 +1,21 @@
--- TailFile.h.orig Wed Aug 4 04:42:33 1999
+++ TailFile.h Thu Feb 5 19:49:47 2004
@@ -23,7 +23,8 @@
#include "Colorizer.h"
#include <stdio.h>
-#include <strstream.h>
+#include <iostream>
+#include <strstream>
#define MAX_CHARS_READ 1024
@@ -40,7 +41,7 @@
// the stream position
long m_position;
// the follow buffer, used in follow_print
- ostrstream *m_follow_buffer;
+ std::ostrstream *m_follow_buffer;
// private methods
void find_position(int n);