/ Check-in [0165789f]
Login

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

Overview
Comment:Get the new URI logic working for Windows.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | uri-enhancement
Files: files | file ages | folders
SHA1: 0165789f08339810a42f9dc73f8660d0112a6bed
User & Date: drh 2013-07-23 22:28:16
Context
2013-07-23
22:28
Get the new URI logic working for Windows. Closed-Leaf check-in: 0165789f user: drh tags: uri-enhancement
20:54
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. check-in: 74c12dee user: drh tags: uri-enhancement
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  2186   2186       ** file://localhost/xyz    /xyz              //localhost/xyz
  2187   2187       ** file:///c:/xyz          /c:/xyz           c:/xyz
  2188   2188       ** file:xyz                xyz               xyz
  2189   2189       ** file:/xyz               /xyz              /xyz
  2190   2190       ** file:c:/xyz             c:/xyz            c:/xyz
  2191   2191       ** file://xyz              //xyz             //xyz
  2192   2192       */
  2193         -#if OS_WIN
  2194         -    if( sqlite3_strglob("///[a-zA-Z]:/*", zUrl+5)==0 ){
  2195         -      iIn = 8;
  2196         -    }else
  2197         -#else
         2193  +    iIn = 5;
  2198   2194       if( zUri[5]=='/' && zUri[6]=='/' ){
         2195  +#if SQLITE_OS_WIN
         2196  +      if( zUri[7]=='/' ){
         2197  +        iIn = 7;
         2198  +        if( sqlite3_strglob("/[a-zA-Z]:/*", zUri+7)==0 ) iIn = 8;
         2199  +      }
         2200  +#else
  2199   2201         iIn = 7;
  2200   2202         while( zUri[iIn] && zUri[iIn]!='/' ) iIn++;
  2201   2203         if( zUri[iIn]!='/' ) iIn = 5;
  2202         -    }else
  2203   2204   #endif
  2204         -    {
  2205         -      iIn = 5;
  2206   2205       }
  2207   2206   
  2208   2207       /* Copy the filename and any query parameters into the zFile buffer. 
  2209   2208       ** Decode %HH escape codes along the way. 
  2210   2209       **
  2211   2210       ** Within this loop, variable eState may be set to 0, 1 or 2, depending
  2212   2211       ** on the parsing context. As follows: