SQLite
Check-in [0165789f]
Not logged in
Overview
SHA1 Hash:0165789f08339810a42f9dc73f8660d0112a6bed
Date: 2013-07-23 22:28:16
User: drh
Comment:Get the new URI logic working for Windows.
Tags And Properties
Context
2013-07-23
22:28
[0165789f] Closed-Leaf: Get the new URI logic working for Windows. (user: drh, tags: uri-enhancement)
20:54
[74c12dee] Update the URI filename parser to allow (and ignore) authority names in unix and to pass the authority through to the OS on windows, as this appears to be what web-browsers are doing. (user: drh, tags: uri-enhancement)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/main.c.

2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198


2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
    ** file://localhost/xyz    /xyz              //localhost/xyz
    ** file:///c:/xyz          /c:/xyz           c:/xyz
    ** file:xyz                xyz               xyz
    ** file:/xyz               /xyz              /xyz
    ** file:c:/xyz             c:/xyz            c:/xyz
    ** file://xyz              //xyz             //xyz
    */
#if OS_WIN
    if( sqlite3_strglob("///[a-zA-Z]:/*", zUrl+5)==0 ){
      iIn = 8;
    }else
#else
    if( zUri[5]=='/' && zUri[6]=='/' ){


      iIn = 7;
      while( zUri[iIn] && zUri[iIn]!='/' ) iIn++;
      if( zUri[iIn]!='/' ) iIn = 5;
    }else
#endif
    {
      iIn = 5;
    }

    /* Copy the filename and any query parameters into the zFile buffer. 
    ** Decode %HH escape codes along the way. 
    **
    ** Within this loop, variable eState may be set to 0, 1 or 2, depending
    ** on the parsing context. As follows:







|
|
|
|
|
|
>
>



<

<
<







2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203

2204


2205
2206
2207
2208
2209
2210
2211
    ** file://localhost/xyz    /xyz              //localhost/xyz
    ** file:///c:/xyz          /c:/xyz           c:/xyz
    ** file:xyz                xyz               xyz
    ** file:/xyz               /xyz              /xyz
    ** file:c:/xyz             c:/xyz            c:/xyz
    ** file://xyz              //xyz             //xyz
    */
    iIn = 5;
    if( zUri[5]=='/' && zUri[6]=='/' ){
#if SQLITE_OS_WIN
      if( zUri[7]=='/' ){
        iIn = 7;
        if( sqlite3_strglob("/[a-zA-Z]:/*", zUri+7)==0 ) iIn = 8;
      }
#else
      iIn = 7;
      while( zUri[iIn] && zUri[iIn]!='/' ) iIn++;
      if( zUri[iIn]!='/' ) iIn = 5;

#endif


    }

    /* Copy the filename and any query parameters into the zFile buffer. 
    ** Decode %HH escape codes along the way. 
    **
    ** Within this loop, variable eState may be set to 0, 1 or 2, depending
    ** on the parsing context. As follows: