File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.21 1997/09/08 21:48:42 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.22 1997/11/23 21:39:12 momjian Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -253,9 +253,14 @@ textcat(text *t1, text *t2)
253
253
len1 = (PointerIsValid (t1 ) ? (VARSIZE (t1 ) - VARHDRSZ ) : 0 );
254
254
if (len1 < 0 )
255
255
len1 = 0 ;
256
+ while (len1 > 0 && VARDATA (t1 )[len1 - 1 ] == '\0' )
257
+ len1 -- ;
258
+
256
259
len2 = (PointerIsValid (t2 ) ? (VARSIZE (t2 ) - VARHDRSZ ) : 0 );
257
260
if (len2 < 0 )
258
261
len2 = 0 ;
262
+ while (len2 > 0 && VARDATA (t2 )[len2 - 1 ] == '\0' )
263
+ len2 -- ;
259
264
260
265
result = PALLOC (len = len1 + len2 + VARHDRSZ );
261
266
You can’t perform that action at this time.
0 commit comments