SQLite

Check-in [9593a64079]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix an off-by-one error in the new sqlite3_uri_parameter() function.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9593a640795458ce6e57e02dd5d702b642858f76
User & Date: drh 2011-05-17 19:43:38.641
Context
2011-05-17
20:36
Add the ability to limit filenames to 8+3 using the SQLITE_ENABLE_8_3_NAMES compile-time option together with a URI parameter of "8_3_names=1". (check-in: 96d6098560 user: drh tags: trunk)
19:43
Fix an off-by-one error in the new sqlite3_uri_parameter() function. (check-in: 9593a64079 user: drh tags: trunk)
18:53
Add the sqlite3_uri_parameter() interface function for use in building new VFSes. (check-in: 6b5de95fb5 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
** The zFilename argument is the filename pointer passed into the xOpen()
** method of a VFS implementation.  The zParam argument is the name of the
** query parameter we seek.  This routine returns the value of the zParam
** parameter if it exists.  If the parameter does not exist, this routine
** returns a NULL pointer.
*/
const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){
  zFilename += sqlite3Strlen30(zFilename);
  while( zFilename[0] ){
    int x = strcmp(zFilename, zParam);
    zFilename += sqlite3Strlen30(zFilename);
    if( x==0 ) return zFilename;
    zFilename += sqlite3Strlen30(zFilename);
  }
  return 0;
}







|


|

|



2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
** The zFilename argument is the filename pointer passed into the xOpen()
** method of a VFS implementation.  The zParam argument is the name of the
** query parameter we seek.  This routine returns the value of the zParam
** parameter if it exists.  If the parameter does not exist, this routine
** returns a NULL pointer.
*/
const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){
  zFilename += sqlite3Strlen30(zFilename) + 1;
  while( zFilename[0] ){
    int x = strcmp(zFilename, zParam);
    zFilename += sqlite3Strlen30(zFilename) + 1;
    if( x==0 ) return zFilename;
    zFilename += sqlite3Strlen30(zFilename) + 1;
  }
  return 0;
}