Index: src/backend/lib/stringinfo.c
===================================================================
RCS file: /repositories/edbhome/cvs/EDBAS82/edb/edb-postgres/src/backend/lib/stringinfo.c,v
retrieving revision 1.3
diff -c -r1.3 stringinfo.c
*** src/backend/lib/stringinfo.c	9 Nov 2006 11:09:09 -0000	1.3
--- src/backend/lib/stringinfo.c	29 Aug 2007 14:37:58 -0000
***************
*** 226,232 ****
  	 * bogus data.	Without this, we can get an overflow or infinite loop in
  	 * the following.
  	 */
! 	if (needed < 0 ||
  		((Size) needed) >= (MaxAllocSize - (Size) str->len))
  		elog(ERROR, "invalid string enlargement request size %d",
  			 needed);
--- 226,232 ----
  	 * bogus data.	Without this, we can get an overflow or infinite loop in
  	 * the following.
  	 */
! 	if (needed <= 0 ||
  		((Size) needed) >= (MaxAllocSize - (Size) str->len))
  		elog(ERROR, "invalid string enlargement request size %d",
  			 needed);
***************
*** 259,261 ****
--- 259,272 ----
  
  	str->maxlen = newlen;
  }
+ 
+ /*
+  * resetStringInfo
+  * Reset the len field and the data field contents for a fresh start
+  */
+ void 
+ resetStringInfo(StringInfo str)
+ {
+ 	str->len = 0;
+ 	str->data[0] = '\0';
+ }
Index: src/include/lib/stringinfo.h
===================================================================
RCS file: /repositories/edbhome/cvs/EDBAS82/edb/edb-postgres/src/include/lib/stringinfo.h,v
retrieving revision 1.3
diff -c -r1.3 stringinfo.h
*** src/include/lib/stringinfo.h	9 Nov 2006 11:09:17 -0000	1.3
--- src/include/lib/stringinfo.h	29 Aug 2007 14:37:58 -0000
***************
*** 138,141 ****
--- 138,146 ----
   */
  extern void enlargeStringInfo(StringInfo str, int needed);
  
+ /*------------------------
+  * resetStringInfo
+  * Reset the len field and the data field contents for a fresh start
+  */
+ extern void resetStringInfo(StringInfo str);
  #endif   /* STRINGINFO_H */
