Title: [opsview-base] [230] Fixed trailing \n\n into ndo.dat file
Revision
230
Author
tvoon
Date
2013-03-23 00:18:17 +0000 (Sat, 23 Mar 2013)

Log Message

Fixed trailing \n\n into ndo.dat file

Modified Paths


Added Paths

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2013-03-22 18:25:56 UTC (rev 229)
+++ trunk/Makefile	2013-03-23 00:18:17 UTC (rev 230)
@@ -823,6 +823,7 @@
 	# cd ${NDOUTILS} && patch -p1 < ../patches/ndoutils_fix_memory_leak_multiple_hellos.patch
 	cd ${NDOUTILS} && patch -p1 < ../patches/ndoutils_statedata_with_acks_downtime.patch
 	# cd ${NDOUTILS} && patch -p1 < ../patches/ndoutils_performance_improvement_for_object_lookup.patch
+	cd ${NDOUTILS} && patch -p1 < ../patches/ndoutils_with_fixed_multiple_newlines_at_end.patch
 	# cd ${NDOUTILS} && aclocal -I m4 && autoconf
 	# #cp patches/ndoutils_upgradedb.pl ${NDOUTILS}/db/upgradedb.pl
 	# #cp patches/ndoutils_mysql-upgrade-1.4b3.sql ${NDOUTILS}/db/mysql-upgrade-1.4b3.sql

Added: trunk/patches/ndoutils_with_fixed_multiple_newlines_at_end.patch
===================================================================
--- trunk/patches/ndoutils_with_fixed_multiple_newlines_at_end.patch	                        (rev 0)
+++ trunk/patches/ndoutils_with_fixed_multiple_newlines_at_end.patch	2013-03-23 00:18:17 UTC (rev 230)
@@ -0,0 +1,38 @@
+diff -ur ndoutils-2-0/src/io.c ndoutils-2-0.with_fiex_unescape_newlines/src/io.c
+--- ndoutils-2-0/src/io.c	2013-03-23 00:12:59.000000000 +0000
++++ ndoutils-2-0.with_fiex_unescape_newlines/src/io.c	2013-03-23 00:10:35.000000000 +0000
+@@ -545,26 +545,19 @@
+ 	register int x,y;
+ 
+ 	for(x=0,y=0;rawbuf[x]!=(char)'\x0';x++){
+-
+ 		if(rawbuf[x]=='\\'){
+-
+-			/* unescape newlines */
+-			if(rawbuf[x+1]=='n'){
++			if(rawbuf[x+1]=='n')
+ 				rawbuf[y++]='\n';
+-				x++;
+-				}
+-
+-			/* unescape backslashes and other stuff */
+-			if(rawbuf[x+1]!='\x0'){
++			else
+ 				rawbuf[y++]=rawbuf[x+1];
+-				x++;
+-				}
+-
+-			}
++			x++;
++		        }
+ 		else
+ 			rawbuf[y++]=rawbuf[x];
+-		}
+-	rawbuf[y]='\x0';
++	        }
++
++	/* terminate string */
++	rawbuf[y++]='\x0';
+ 
+ 	return rawbuf;
+ 	}

_______________________________________________
Opsview-checkins mailing list
Opsview-checkins@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-checkins

Reply via email to