mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-15 11:41:13 +03:00
Make sure of the strchrnul() library function on platforms where it is
available. FossilOrigin-Name: ef1aa10b7f54912cba71cd0a98c5055d501de54f
This commit is contained in:
13
manifest
13
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Merge\smicro-optimizations\sinto\strunk\safter\sfixing\sthe\sbuild\son\sMSVC.\nPerformance\snow\sshows\s7.58%\sfaster\sthan\sthe\s3.8.6\srelease\son\sx64\swith\ngcc\s4.8.1\sand\s-Os.
|
C Make\ssure\sof\sthe\sstrchrnul()\slibrary\sfunction\son\splatforms\swhere\sit\sis\navailable.
|
||||||
D 2014-09-18T01:29:11.287
|
D 2014-09-18T01:50:09.699
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a
|
F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@@ -222,7 +222,7 @@ F src/pcache.h 9b559127b83f84ff76d735c8262f04853be0c59a
|
|||||||
F src/pcache1.c dab8ab930d4a73b99768d881185994f34b80ecaa
|
F src/pcache1.c dab8ab930d4a73b99768d881185994f34b80ecaa
|
||||||
F src/pragma.c 3f3e959390a10c0131676f0e307acce372777e0f
|
F src/pragma.c 3f3e959390a10c0131676f0e307acce372777e0f
|
||||||
F src/prepare.c 6ef0cf2f9274982988ed6b7cab1be23147e94196
|
F src/prepare.c 6ef0cf2f9274982988ed6b7cab1be23147e94196
|
||||||
F src/printf.c e74925089a85e3c9f0e315595f41c139d3d118c2
|
F src/printf.c 19e3e81addf593195369ec8d487ed063ad3170bb
|
||||||
F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece
|
F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece
|
||||||
F src/resolve.c a3466128b52a86c466e47ac1a19e2174f7b5cf89
|
F src/resolve.c a3466128b52a86c466e47ac1a19e2174f7b5cf89
|
||||||
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
|
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
|
||||||
@@ -1198,8 +1198,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
|||||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||||
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
||||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||||
P 8fb90da77ce0e662c1ef1ae0d854e5164494b7af 163bfae8583b2d3002a3a43d6bf8a66fefd73acb
|
P 1de558bcb13edc4e9a42a0b05e4b0ed6b14286a4
|
||||||
R fdb25cd80d01110b7b302f5203339ac7
|
R 5de5c16595c1a6599607c0d453169480
|
||||||
T +closed 163bfae8583b2d3002a3a43d6bf8a66fefd73acb
|
|
||||||
U drh
|
U drh
|
||||||
Z a578f94c122b57df374e40cc66ef0667
|
Z 45b315c664f0110e7c4a00564360b273
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1de558bcb13edc4e9a42a0b05e4b0ed6b14286a4
|
ef1aa10b7f54912cba71cd0a98c5055d501de54f
|
||||||
23
src/printf.c
23
src/printf.c
@@ -14,6 +14,21 @@
|
|||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
** If the strchrnul() library function is available, then set
|
||||||
|
** HAVE_STRCHRNUL. If that routine is not available, this module
|
||||||
|
** will supply its own. The built-in version is slower than
|
||||||
|
** the glibc version so the glibc version is definitely preferred.
|
||||||
|
*/
|
||||||
|
#if !defined(HAVE_STRCHRNUL)
|
||||||
|
# if defined(__linux__) && defined(_GNU_SOURCE)
|
||||||
|
# define HAVE_STRCHRNUL 1
|
||||||
|
# else
|
||||||
|
# define HAVE_STRCHRNUL 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Conversion types fall into various categories as defined by the
|
** Conversion types fall into various categories as defined by the
|
||||||
** following enumeration.
|
** following enumeration.
|
||||||
@@ -224,9 +239,13 @@ void sqlite3VXPrintf(
|
|||||||
for(; (c=(*fmt))!=0; ++fmt){
|
for(; (c=(*fmt))!=0; ++fmt){
|
||||||
if( c!='%' ){
|
if( c!='%' ){
|
||||||
bufpt = (char *)fmt;
|
bufpt = (char *)fmt;
|
||||||
while( (c=(*++fmt))!='%' && c!=0 ){};
|
#if HAVE_STRCHRNUL
|
||||||
|
fmt = strchrnul(fmt, '%');
|
||||||
|
#else
|
||||||
|
do{ fmt++; }while( *fmt && *fmt != '%' );
|
||||||
|
#endif
|
||||||
sqlite3StrAccumAppend(pAccum, bufpt, (int)(fmt - bufpt));
|
sqlite3StrAccumAppend(pAccum, bufpt, (int)(fmt - bufpt));
|
||||||
if( c==0 ) break;
|
if( *fmt==0 ) break;
|
||||||
}
|
}
|
||||||
if( (c=(*++fmt))==0 ){
|
if( (c=(*++fmt))==0 ){
|
||||||
sqlite3StrAccumAppend(pAccum, "%", 1);
|
sqlite3StrAccumAppend(pAccum, "%", 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user