1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Add and use the internal sqlite3DbSpanDup() interface.

FossilOrigin-Name: a8e1545cb7aacb6a26a8c92a3ad4a3d584d150c3a00d2828c8adbb1ee19fcb6d
This commit is contained in:
drh
2017-12-27 19:43:22 +00:00
parent 908cc6207f
commit 9b2e0435d2
7 changed files with 28 additions and 22 deletions

View File

@@ -1661,13 +1661,9 @@ void sqlite3ExprListSetSpan(
assert( pList!=0 || db->mallocFailed!=0 );
if( pList ){
struct ExprList_item *pItem = &pList->a[pList->nExpr-1];
int n;
assert( pList->nExpr>0 );
sqlite3DbFree(db, pItem->zSpan);
while( sqlite3Isspace(zStart[0]) ) zStart++;
n = (int)(zEnd - zStart);
while( n>0 && sqlite3Isspace(zStart[n-1]) ) n--;
pItem->zSpan = sqlite3DbStrNDup(db, zStart, n);
pItem->zSpan = sqlite3DbSpanDup(db, zStart, zEnd);
}
}