[Nagios-devel] Bad object data always outputs line 0
Posted: Sat Dec 04, 2004 1:15 am
This is a multi-part message in MIME format.
--------------000601020206050505030602
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
In xdata/xodtemplate.c, the function xodtemplate_process_config_file()
doesn't accurately keep track of what line it's currently on.
It's not really serious, but annoying just the same.
The attached patch takes care of it.
--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Lead Developer
--------------000601020206050505030602
Content-Type: text/plain;
name="nagios-HEAD-lines_read.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nagios-HEAD-lines_read.diff"
diff -urN ../../Nagios/xdata/CVS/Entries ./xdata/CVS/Entries
--- ../../Nagios/xdata/CVS/Entries 2004-12-03 13:54:31.000000000 +0100
+++ ./xdata/CVS/Entries 2004-12-03 13:16:08.000000000 +0100
@@ -10,5 +10,5 @@
/xsddefault.h/1.3/Fri Nov 5 14:18:53 2004//
/xpddefault.c/1.19/Wed Dec 1 19:16:03 2004//
/xpddefault.h/1.7/Wed Dec 1 19:16:03 2004//
-/xodtemplate.c/1.89/Fri Dec 3 12:54:25 2004//
+/xodtemplate.c/1.89/Fri Dec 3 12:16:08 2004//
D
diff -urN ../../Nagios/xdata/xodtemplate.c ./xdata/xodtemplate.c
--- ../../Nagios/xdata/xodtemplate.c 2004-12-03 13:54:25.000000000 +0100
+++ ./xdata/xodtemplate.c 2004-12-03 13:54:53.000000000 +0100
@@ -545,7 +545,6 @@
int result=OK;
register int x;
register int y;
- int lines_read=0;
char *ptr;
#ifdef NSCORE
char temp_buffer[MAX_INPUT_BUFFER];
@@ -590,7 +589,7 @@
if((input=mmap_fgets(thefile))==NULL)
break;
- current_line+=lines_read;
+ current_line++;
/* skip empty lines */
if(input[0]=='#' || input[0]==';' || input[0]=='\r' || input[0]=='\n')
--------------000601020206050505030602--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
--------------000601020206050505030602
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
In xdata/xodtemplate.c, the function xodtemplate_process_config_file()
doesn't accurately keep track of what line it's currently on.
It's not really serious, but annoying just the same.
The attached patch takes care of it.
--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Lead Developer
--------------000601020206050505030602
Content-Type: text/plain;
name="nagios-HEAD-lines_read.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nagios-HEAD-lines_read.diff"
diff -urN ../../Nagios/xdata/CVS/Entries ./xdata/CVS/Entries
--- ../../Nagios/xdata/CVS/Entries 2004-12-03 13:54:31.000000000 +0100
+++ ./xdata/CVS/Entries 2004-12-03 13:16:08.000000000 +0100
@@ -10,5 +10,5 @@
/xsddefault.h/1.3/Fri Nov 5 14:18:53 2004//
/xpddefault.c/1.19/Wed Dec 1 19:16:03 2004//
/xpddefault.h/1.7/Wed Dec 1 19:16:03 2004//
-/xodtemplate.c/1.89/Fri Dec 3 12:54:25 2004//
+/xodtemplate.c/1.89/Fri Dec 3 12:16:08 2004//
D
diff -urN ../../Nagios/xdata/xodtemplate.c ./xdata/xodtemplate.c
--- ../../Nagios/xdata/xodtemplate.c 2004-12-03 13:54:25.000000000 +0100
+++ ./xdata/xodtemplate.c 2004-12-03 13:54:53.000000000 +0100
@@ -545,7 +545,6 @@
int result=OK;
register int x;
register int y;
- int lines_read=0;
char *ptr;
#ifdef NSCORE
char temp_buffer[MAX_INPUT_BUFFER];
@@ -590,7 +589,7 @@
if((input=mmap_fgets(thefile))==NULL)
break;
- current_line+=lines_read;
+ current_line++;
/* skip empty lines */
if(input[0]=='#' || input[0]==';' || input[0]=='\r' || input[0]=='\n')
--------------000601020206050505030602--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]