1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-24 09:53:10 +03:00

The replace() function should return NULL if the second argument is an

empty string.  Ticket #2324. (CVS 3877)

FossilOrigin-Name: e6a0c90dd9b4f7efe2153dd0c899b6e3d9846bd8
This commit is contained in:
drh
2007-04-27 01:18:02 +00:00
parent dddbcdcc68
commit 709cff33dc
4 changed files with 18 additions and 12 deletions

View File

@@ -16,7 +16,7 @@
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: func.c,v 1.140 2007/04/25 18:23:53 drh Exp $
** $Id: func.c,v 1.141 2007/04/27 01:18:03 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -707,7 +707,7 @@ static void replaceFunc(
if( zStr==0 ) return;
nStr = sqlite3_value_bytes(argv[0]);
zPattern = sqlite3_value_text(argv[1]);
if( zPattern==0 ) return;
if( zPattern==0 || zPattern[0]==0 ) return;
nPattern = sqlite3_value_bytes(argv[1]);
zRep = sqlite3_value_text(argv[2]);
if( zRep==0 ) return;