the following patch fixes a bug in the oracle compatibility
functions btrim() ltrim() and rtrim(). The error was that the character after the set was included in the tests (ptr2 pointed to the character after the vardata part of set if no match found, so comparing *ptr or *end against *ptr2 MAY match -> strip). Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #======================================== jwieck@debis.com (Jan Wieck) #
This commit is contained in:
parent
c6dd1e63a9
commit
f22c6f9237
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Edmund Mergl <E.Mergl@bawue.de>
|
||||
*
|
||||
* $Id: oracle_compat.c,v 1.14 1998/06/15 19:29:36 momjian Exp $
|
||||
* $Id: oracle_compat.c,v 1.15 1998/08/11 18:38:07 momjian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -297,7 +297,7 @@ btrim(text *string, text *set)
|
||||
break;
|
||||
++ptr2;
|
||||
}
|
||||
if (*ptr != *ptr2)
|
||||
if (ptr2 > end2)
|
||||
break;
|
||||
ptr++;
|
||||
ptr2 = VARDATA(set);
|
||||
@ -316,7 +316,7 @@ btrim(text *string, text *set)
|
||||
break;
|
||||
++ptr2;
|
||||
}
|
||||
if (*end != *ptr2)
|
||||
if (ptr2 > end2)
|
||||
break;
|
||||
--end;
|
||||
ptr2 = VARDATA(set);
|
||||
@ -374,7 +374,7 @@ ltrim(text *string, text *set)
|
||||
break;
|
||||
++ptr2;
|
||||
}
|
||||
if (*ptr != *ptr2)
|
||||
if (ptr2 > end2)
|
||||
break;
|
||||
ptr++;
|
||||
ptr2 = VARDATA(set);
|
||||
@ -434,7 +434,7 @@ rtrim(text *string, text *set)
|
||||
break;
|
||||
++ptr2;
|
||||
}
|
||||
if (*ptr != *ptr2)
|
||||
if (ptr2 > end2)
|
||||
break;
|
||||
--ptr;
|
||||
ptr2 = VARDATA(set);
|
||||
|
Loading…
x
Reference in New Issue
Block a user