Fossil SCM
Merge trunk. Eliminate need for special Makefile.Cygwin. Simplify handling of '\\?\' prefix: Only add it when necessary (calculated path>=260 chars).
Commit
23b849cce52d18982c43e0d7ef2b865f2b0c03e1
Parent
46e1d4c812e2fef…
10 files changed
-52
-52
-1
-1
+1
-2
+12
-12
+1
+44
-30
+44
-30
+4
D
Makefile.Cygwin.in
-52
| --- a/Makefile.Cygwin.in | ||
| +++ b/Makefile.Cygwin.in | ||
| @@ -1,52 +0,0 @@ | ||
| 1 | -#!/usr/bin/make | |
| 2 | -# | |
| 3 | -# This is the top-level makefile for Fossil when the build is occurring | |
| 4 | -# on the Cygwin platform. | |
| 5 | -# | |
| 6 | -#### The toplevel directory of the source tree. Fossil can be built | |
| 7 | -# in a directory that is separate from the source tree. Just change | |
| 8 | -# the following to point from the build directory to the src/ folder. | |
| 9 | -# | |
| 10 | -SRCDIR = @srcdir@/src | |
| 11 | - | |
| 12 | -#### The directory into which object code files should be written. | |
| 13 | -# Having a "./" prefix in the value of this variable breaks our use of the | |
| 14 | -# "makeheaders" tool when running make on the MinGW platform, apparently | |
| 15 | -# due to some command line argument manipulation performed automatically | |
| 16 | -# by the shell. | |
| 17 | -# | |
| 18 | -# | |
| 19 | -OBJDIR = bld | |
| 20 | - | |
| 21 | -#### C Compiler and options for use in building executables that | |
| 22 | -# will run on the platform that is doing the build. This is used | |
| 23 | -# to compile code-generator programs as part of the build process. | |
| 24 | -# See TCC below for the C compiler for building the finished binary. | |
| 25 | -# | |
| 26 | -BCC = @CC_FOR_BUILD@ | |
| 27 | - | |
| 28 | -#### The suffix to add to final executable file. When cross-compiling | |
| 29 | -# to windows, make this ".exe". Otherwise leave it blank. | |
| 30 | -# | |
| 31 | -E = @EXEEXT@ | |
| 32 | - | |
| 33 | -TCC = @CC@ | |
| 34 | - | |
| 35 | -#### Tcl shell for use in running the fossil testsuite. If you do not | |
| 36 | -# care about testing the end result, this can be blank. | |
| 37 | -# | |
| 38 | -TCLSH = tclsh | |
| 39 | - | |
| 40 | -LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ | |
| 41 | -TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @ | |
| 42 | -INSTALLDIR =$(DESTDIR)@prefix@/bin | |
| 43 | -USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ | |
| 44 | -FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@ | |
| 45 | -FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@ | |
| 46 | -FOSSIL_ENABLE_TCL_PRIVATE_STUBS = @FOSSIL_ENABLE_TCL_PRIVATE_STUBS@ | |
| 47 | -SQLITE_CFLAG -DSQLITE_WINNT_MAX_PATH_CHARS=4096BYTES=4096 | |
| 48 | -SQLITE_CFLAGS +=TE_MAX_MMAP_SIZE=0x7fff0000 | |
| 49 | - | |
| 50 | -include $(SRCDIR)/main.mk | |
| 51 | - | |
| 52 | -dis |
| --- a/Makefile.Cygwin.in | |
| +++ b/Makefile.Cygwin.in | |
| @@ -1,52 +0,0 @@ | |
| 1 | #!/usr/bin/make |
| 2 | # |
| 3 | # This is the top-level makefile for Fossil when the build is occurring |
| 4 | # on the Cygwin platform. |
| 5 | # |
| 6 | #### The toplevel directory of the source tree. Fossil can be built |
| 7 | # in a directory that is separate from the source tree. Just change |
| 8 | # the following to point from the build directory to the src/ folder. |
| 9 | # |
| 10 | SRCDIR = @srcdir@/src |
| 11 | |
| 12 | #### The directory into which object code files should be written. |
| 13 | # Having a "./" prefix in the value of this variable breaks our use of the |
| 14 | # "makeheaders" tool when running make on the MinGW platform, apparently |
| 15 | # due to some command line argument manipulation performed automatically |
| 16 | # by the shell. |
| 17 | # |
| 18 | # |
| 19 | OBJDIR = bld |
| 20 | |
| 21 | #### C Compiler and options for use in building executables that |
| 22 | # will run on the platform that is doing the build. This is used |
| 23 | # to compile code-generator programs as part of the build process. |
| 24 | # See TCC below for the C compiler for building the finished binary. |
| 25 | # |
| 26 | BCC = @CC_FOR_BUILD@ |
| 27 | |
| 28 | #### The suffix to add to final executable file. When cross-compiling |
| 29 | # to windows, make this ".exe". Otherwise leave it blank. |
| 30 | # |
| 31 | E = @EXEEXT@ |
| 32 | |
| 33 | TCC = @CC@ |
| 34 | |
| 35 | #### Tcl shell for use in running the fossil testsuite. If you do not |
| 36 | # care about testing the end result, this can be blank. |
| 37 | # |
| 38 | TCLSH = tclsh |
| 39 | |
| 40 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 41 | TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @ |
| 42 | INSTALLDIR =$(DESTDIR)@prefix@/bin |
| 43 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 44 | FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@ |
| 45 | FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@ |
| 46 | FOSSIL_ENABLE_TCL_PRIVATE_STUBS = @FOSSIL_ENABLE_TCL_PRIVATE_STUBS@ |
| 47 | SQLITE_CFLAG -DSQLITE_WINNT_MAX_PATH_CHARS=4096BYTES=4096 |
| 48 | SQLITE_CFLAGS +=TE_MAX_MMAP_SIZE=0x7fff0000 |
| 49 | |
| 50 | include $(SRCDIR)/main.mk |
| 51 | |
| 52 | dis |
| --- a/Makefile.Cygwin.in | |
| +++ b/Makefile.Cygwin.in | |
| @@ -1,52 +0,0 @@ | |
D
Makefile.Cygwin.in
-52
| --- a/Makefile.Cygwin.in | ||
| +++ b/Makefile.Cygwin.in | ||
| @@ -1,52 +0,0 @@ | ||
| 1 | -#!/usr/bin/make | |
| 2 | -# | |
| 3 | -# This is the top-level makefile for Fossil when the build is occurring | |
| 4 | -# on the Cygwin platform. | |
| 5 | -# | |
| 6 | -#### The toplevel directory of the source tree. Fossil can be built | |
| 7 | -# in a directory that is separate from the source tree. Just change | |
| 8 | -# the following to point from the build directory to the src/ folder. | |
| 9 | -# | |
| 10 | -SRCDIR = @srcdir@/src | |
| 11 | - | |
| 12 | -#### The directory into which object code files should be written. | |
| 13 | -# Having a "./" prefix in the value of this variable breaks our use of the | |
| 14 | -# "makeheaders" tool when running make on the MinGW platform, apparently | |
| 15 | -# due to some command line argument manipulation performed automatically | |
| 16 | -# by the shell. | |
| 17 | -# | |
| 18 | -# | |
| 19 | -OBJDIR = bld | |
| 20 | - | |
| 21 | -#### C Compiler and options for use in building executables that | |
| 22 | -# will run on the platform that is doing the build. This is used | |
| 23 | -# to compile code-generator programs as part of the build process. | |
| 24 | -# See TCC below for the C compiler for building the finished binary. | |
| 25 | -# | |
| 26 | -BCC = @CC_FOR_BUILD@ | |
| 27 | - | |
| 28 | -#### The suffix to add to final executable file. When cross-compiling | |
| 29 | -# to windows, make this ".exe". Otherwise leave it blank. | |
| 30 | -# | |
| 31 | -E = @EXEEXT@ | |
| 32 | - | |
| 33 | -TCC = @CC@ | |
| 34 | - | |
| 35 | -#### Tcl shell for use in running the fossil testsuite. If you do not | |
| 36 | -# care about testing the end result, this can be blank. | |
| 37 | -# | |
| 38 | -TCLSH = tclsh | |
| 39 | - | |
| 40 | -LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ | |
| 41 | -TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @ | |
| 42 | -INSTALLDIR =$(DESTDIR)@prefix@/bin | |
| 43 | -USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ | |
| 44 | -FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@ | |
| 45 | -FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@ | |
| 46 | -FOSSIL_ENABLE_TCL_PRIVATE_STUBS = @FOSSIL_ENABLE_TCL_PRIVATE_STUBS@ | |
| 47 | -SQLITE_CFLAG -DSQLITE_WINNT_MAX_PATH_CHARS=4096BYTES=4096 | |
| 48 | -SQLITE_CFLAGS +=TE_MAX_MMAP_SIZE=0x7fff0000 | |
| 49 | - | |
| 50 | -include $(SRCDIR)/main.mk | |
| 51 | - | |
| 52 | -dis |
| --- a/Makefile.Cygwin.in | |
| +++ b/Makefile.Cygwin.in | |
| @@ -1,52 +0,0 @@ | |
| 1 | #!/usr/bin/make |
| 2 | # |
| 3 | # This is the top-level makefile for Fossil when the build is occurring |
| 4 | # on the Cygwin platform. |
| 5 | # |
| 6 | #### The toplevel directory of the source tree. Fossil can be built |
| 7 | # in a directory that is separate from the source tree. Just change |
| 8 | # the following to point from the build directory to the src/ folder. |
| 9 | # |
| 10 | SRCDIR = @srcdir@/src |
| 11 | |
| 12 | #### The directory into which object code files should be written. |
| 13 | # Having a "./" prefix in the value of this variable breaks our use of the |
| 14 | # "makeheaders" tool when running make on the MinGW platform, apparently |
| 15 | # due to some command line argument manipulation performed automatically |
| 16 | # by the shell. |
| 17 | # |
| 18 | # |
| 19 | OBJDIR = bld |
| 20 | |
| 21 | #### C Compiler and options for use in building executables that |
| 22 | # will run on the platform that is doing the build. This is used |
| 23 | # to compile code-generator programs as part of the build process. |
| 24 | # See TCC below for the C compiler for building the finished binary. |
| 25 | # |
| 26 | BCC = @CC_FOR_BUILD@ |
| 27 | |
| 28 | #### The suffix to add to final executable file. When cross-compiling |
| 29 | # to windows, make this ".exe". Otherwise leave it blank. |
| 30 | # |
| 31 | E = @EXEEXT@ |
| 32 | |
| 33 | TCC = @CC@ |
| 34 | |
| 35 | #### Tcl shell for use in running the fossil testsuite. If you do not |
| 36 | # care about testing the end result, this can be blank. |
| 37 | # |
| 38 | TCLSH = tclsh |
| 39 | |
| 40 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 41 | TCC += @EXTRA_CFLAGS@ @CPPFLAGS@ @ |
| 42 | INSTALLDIR =$(DESTDIR)@prefix@/bin |
| 43 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 44 | FOSSIL_ENABLE_TCL = @FOSSIL_ENABLE_TCL@ |
| 45 | FOSSIL_ENABLE_TCL_STUBS = @FOSSIL_ENABLE_TCL_STUBS@ |
| 46 | FOSSIL_ENABLE_TCL_PRIVATE_STUBS = @FOSSIL_ENABLE_TCL_PRIVATE_STUBS@ |
| 47 | SQLITE_CFLAG -DSQLITE_WINNT_MAX_PATH_CHARS=4096BYTES=4096 |
| 48 | SQLITE_CFLAGS +=TE_MAX_MMAP_SIZE=0x7fff0000 |
| 49 | |
| 50 | include $(SRCDIR)/main.mk |
| 51 | |
| 52 | dis |
| --- a/Makefile.Cygwin.in | |
| +++ b/Makefile.Cygwin.in | |
| @@ -1,52 +0,0 @@ | |
M
auto.def
-1
| --- auto.def | ||
| +++ auto.def | ||
| @@ -257,7 +257,6 @@ | ||
| 257 | 257 | cc-check-function-in-lib getpass bsd |
| 258 | 258 | } |
| 259 | 259 | cc-check-function-in-lib dlopen dl |
| 260 | 260 | |
| 261 | 261 | make-template Makefile.in |
| 262 | -make-template Makefile.Cygwin.in | |
| 263 | 262 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 264 | 263 |
| --- auto.def | |
| +++ auto.def | |
| @@ -257,7 +257,6 @@ | |
| 257 | cc-check-function-in-lib getpass bsd |
| 258 | } |
| 259 | cc-check-function-in-lib dlopen dl |
| 260 | |
| 261 | make-template Makefile.in |
| 262 | make-template Makefile.Cygwin.in |
| 263 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 264 |
| --- auto.def | |
| +++ auto.def | |
| @@ -257,7 +257,6 @@ | |
| 257 | cc-check-function-in-lib getpass bsd |
| 258 | } |
| 259 | cc-check-function-in-lib dlopen dl |
| 260 | |
| 261 | make-template Makefile.in |
| 262 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 263 |
M
auto.def
-1
| --- auto.def | ||
| +++ auto.def | ||
| @@ -257,7 +257,6 @@ | ||
| 257 | 257 | cc-check-function-in-lib getpass bsd |
| 258 | 258 | } |
| 259 | 259 | cc-check-function-in-lib dlopen dl |
| 260 | 260 | |
| 261 | 261 | make-template Makefile.in |
| 262 | -make-template Makefile.Cygwin.in | |
| 263 | 262 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 264 | 263 |
| --- auto.def | |
| +++ auto.def | |
| @@ -257,7 +257,6 @@ | |
| 257 | cc-check-function-in-lib getpass bsd |
| 258 | } |
| 259 | cc-check-function-in-lib dlopen dl |
| 260 | |
| 261 | make-template Makefile.in |
| 262 | make-template Makefile.Cygwin.in |
| 263 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 264 |
| --- auto.def | |
| +++ auto.def | |
| @@ -257,7 +257,6 @@ | |
| 257 | cc-check-function-in-lib getpass bsd |
| 258 | } |
| 259 | cc-check-function-in-lib dlopen dl |
| 260 | |
| 261 | make-template Makefile.in |
| 262 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 263 |
+1
-2
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -121,10 +121,11 @@ | ||
| 121 | 121 | int bPrivate = 0; /* Also clone private branches */ |
| 122 | 122 | int urlFlags = URL_PROMPT_PW | URL_REMEMBER; |
| 123 | 123 | |
| 124 | 124 | if( find_option("private",0,0)!=0 ) bPrivate = SYNC_PRIVATE; |
| 125 | 125 | if( find_option("once",0,0)!=0) urlFlags &= ~URL_REMEMBER; |
| 126 | + zDefaultUser = find_option("admin-user","A",1); | |
| 126 | 127 | clone_ssh_find_options(); |
| 127 | 128 | url_proxy_options(); |
| 128 | 129 | if( g.argc < 4 ){ |
| 129 | 130 | usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY"); |
| 130 | 131 | } |
| @@ -131,12 +132,10 @@ | ||
| 131 | 132 | db_open_config(0); |
| 132 | 133 | if( file_size(g.argv[3])>0 ){ |
| 133 | 134 | fossil_fatal("file already exists: %s", g.argv[3]); |
| 134 | 135 | } |
| 135 | 136 | |
| 136 | - zDefaultUser = find_option("admin-user","A",1); | |
| 137 | - | |
| 138 | 137 | url_parse(g.argv[2], urlFlags); |
| 139 | 138 | if( zDefaultUser==0 && g.urlUser!=0 ) zDefaultUser = g.urlUser; |
| 140 | 139 | if( g.urlIsFile ){ |
| 141 | 140 | file_copy(g.urlName, g.argv[3]); |
| 142 | 141 | db_close(1); |
| 143 | 142 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -121,10 +121,11 @@ | |
| 121 | int bPrivate = 0; /* Also clone private branches */ |
| 122 | int urlFlags = URL_PROMPT_PW | URL_REMEMBER; |
| 123 | |
| 124 | if( find_option("private",0,0)!=0 ) bPrivate = SYNC_PRIVATE; |
| 125 | if( find_option("once",0,0)!=0) urlFlags &= ~URL_REMEMBER; |
| 126 | clone_ssh_find_options(); |
| 127 | url_proxy_options(); |
| 128 | if( g.argc < 4 ){ |
| 129 | usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY"); |
| 130 | } |
| @@ -131,12 +132,10 @@ | |
| 131 | db_open_config(0); |
| 132 | if( file_size(g.argv[3])>0 ){ |
| 133 | fossil_fatal("file already exists: %s", g.argv[3]); |
| 134 | } |
| 135 | |
| 136 | zDefaultUser = find_option("admin-user","A",1); |
| 137 | |
| 138 | url_parse(g.argv[2], urlFlags); |
| 139 | if( zDefaultUser==0 && g.urlUser!=0 ) zDefaultUser = g.urlUser; |
| 140 | if( g.urlIsFile ){ |
| 141 | file_copy(g.urlName, g.argv[3]); |
| 142 | db_close(1); |
| 143 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -121,10 +121,11 @@ | |
| 121 | int bPrivate = 0; /* Also clone private branches */ |
| 122 | int urlFlags = URL_PROMPT_PW | URL_REMEMBER; |
| 123 | |
| 124 | if( find_option("private",0,0)!=0 ) bPrivate = SYNC_PRIVATE; |
| 125 | if( find_option("once",0,0)!=0) urlFlags &= ~URL_REMEMBER; |
| 126 | zDefaultUser = find_option("admin-user","A",1); |
| 127 | clone_ssh_find_options(); |
| 128 | url_proxy_options(); |
| 129 | if( g.argc < 4 ){ |
| 130 | usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY"); |
| 131 | } |
| @@ -131,12 +132,10 @@ | |
| 132 | db_open_config(0); |
| 133 | if( file_size(g.argv[3])>0 ){ |
| 134 | fossil_fatal("file already exists: %s", g.argv[3]); |
| 135 | } |
| 136 | |
| 137 | url_parse(g.argv[2], urlFlags); |
| 138 | if( zDefaultUser==0 && g.urlUser!=0 ) zDefaultUser = g.urlUser; |
| 139 | if( g.urlIsFile ){ |
| 140 | file_copy(g.urlName, g.argv[3]); |
| 141 | db_close(1); |
| 142 |
+12
-12
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1770,11 +1770,11 @@ | ||
| 1770 | 1770 | if( modPending ){ |
| 1771 | 1771 | @ <span class="modpending">*** Awaiting Moderator Approval ***</span> |
| 1772 | 1772 | } |
| 1773 | 1773 | @ <tr><th>Ticket:</th> |
| 1774 | 1774 | @ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a> |
| 1775 | - if(zTktTitle){ | |
| 1775 | + if( zTktTitle ){ | |
| 1776 | 1776 | @<br>%h(zTktTitle) |
| 1777 | 1777 | } |
| 1778 | 1778 | @</td></tr> |
| 1779 | 1779 | @ <tr><th>Date:</th><td> |
| 1780 | 1780 | hyperlink_to_date(zDate, "</td></tr>"); |
| @@ -2295,10 +2295,13 @@ | ||
| 2295 | 2295 | @ <td valign="top"> |
| 2296 | 2296 | @ <label><input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) /> |
| 2297 | 2297 | @ Add the following new tag name to this check-in:</label> |
| 2298 | 2298 | @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" |
| 2299 | 2299 | @ onkeyup="gebi('newtag').checked=!!this.value" /> |
| 2300 | + zBranchName = db_text(0, "SELECT value FROM tagxref, tag" | |
| 2301 | + " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" | |
| 2302 | + " AND tagxref.tagid=%d", rid, TAG_BRANCH); | |
| 2300 | 2303 | db_prepare(&q, |
| 2301 | 2304 | "SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag" |
| 2302 | 2305 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2303 | 2306 | " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)" |
| 2304 | 2307 | " ELSE tagname END /*sort*/", |
| @@ -2305,22 +2308,19 @@ | ||
| 2305 | 2308 | rid |
| 2306 | 2309 | ); |
| 2307 | 2310 | while( db_step(&q)==SQLITE_ROW ){ |
| 2308 | 2311 | int tagid = db_column_int(&q, 0); |
| 2309 | 2312 | const char *zTagName = db_column_text(&q, 1); |
| 2310 | - int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0; | |
| 2313 | + int isSpecialTag = fossil_strncmp(zTagName, "sym-", 4)!=0; | |
| 2311 | 2314 | char zLabel[30]; |
| 2312 | 2315 | |
| 2313 | - if (tagid == TAG_CLOSED){ | |
| 2314 | - fHasClosed = 1; | |
| 2315 | - }else if (tagid == TAG_COMMENT){ | |
| 2316 | - continue; | |
| 2317 | - }else if (tagid == TAG_BRANCH){ | |
| 2318 | - zBranchName = mprintf("%s", db_column_text(&q, 2)); | |
| 2319 | - continue; | |
| 2320 | - }else if( !isSpecialTag && zBranchName && | |
| 2321 | - strcmp(&zTagName[4], zBranchName)==0){ | |
| 2316 | + if( tagid == TAG_CLOSED ){ | |
| 2317 | + fHasClosed = 1; | |
| 2318 | + }else if( (tagid == TAG_COMMENT) || (tagid == TAG_BRANCH) ){ | |
| 2319 | + continue; | |
| 2320 | + }else if( !isSpecialTag && zTagName && | |
| 2321 | + fossil_strcmp(&zTagName[4], zBranchName)==0){ | |
| 2322 | 2322 | continue; |
| 2323 | 2323 | } |
| 2324 | 2324 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2325 | 2325 | @ <br /><label> |
| 2326 | 2326 | if( P(zLabel) ){ |
| @@ -2368,11 +2368,11 @@ | ||
| 2368 | 2368 | @ as "closed" so that its leafs no longer appear on the "leaves" page |
| 2369 | 2369 | @ and are no longer labeled as a leaf "<b>Leaf</b>"</label> |
| 2370 | 2370 | @ </td></tr> |
| 2371 | 2371 | } |
| 2372 | 2372 | } |
| 2373 | - if(zBranchName) fossil_free(zBranchName); | |
| 2373 | + if( zBranchName ) fossil_free(zBranchName); | |
| 2374 | 2374 | |
| 2375 | 2375 | |
| 2376 | 2376 | @ <tr><td colspan="2"> |
| 2377 | 2377 | @ <input type="submit" name="preview" value="Preview" /> |
| 2378 | 2378 | @ <input type="submit" name="apply" value="Apply Changes" /> |
| 2379 | 2379 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1770,11 +1770,11 @@ | |
| 1770 | if( modPending ){ |
| 1771 | @ <span class="modpending">*** Awaiting Moderator Approval ***</span> |
| 1772 | } |
| 1773 | @ <tr><th>Ticket:</th> |
| 1774 | @ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a> |
| 1775 | if(zTktTitle){ |
| 1776 | @<br>%h(zTktTitle) |
| 1777 | } |
| 1778 | @</td></tr> |
| 1779 | @ <tr><th>Date:</th><td> |
| 1780 | hyperlink_to_date(zDate, "</td></tr>"); |
| @@ -2295,10 +2295,13 @@ | |
| 2295 | @ <td valign="top"> |
| 2296 | @ <label><input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) /> |
| 2297 | @ Add the following new tag name to this check-in:</label> |
| 2298 | @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" |
| 2299 | @ onkeyup="gebi('newtag').checked=!!this.value" /> |
| 2300 | db_prepare(&q, |
| 2301 | "SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag" |
| 2302 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2303 | " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)" |
| 2304 | " ELSE tagname END /*sort*/", |
| @@ -2305,22 +2308,19 @@ | |
| 2305 | rid |
| 2306 | ); |
| 2307 | while( db_step(&q)==SQLITE_ROW ){ |
| 2308 | int tagid = db_column_int(&q, 0); |
| 2309 | const char *zTagName = db_column_text(&q, 1); |
| 2310 | int isSpecialTag = strncmp(zTagName, "sym-", 4)!=0; |
| 2311 | char zLabel[30]; |
| 2312 | |
| 2313 | if (tagid == TAG_CLOSED){ |
| 2314 | fHasClosed = 1; |
| 2315 | }else if (tagid == TAG_COMMENT){ |
| 2316 | continue; |
| 2317 | }else if (tagid == TAG_BRANCH){ |
| 2318 | zBranchName = mprintf("%s", db_column_text(&q, 2)); |
| 2319 | continue; |
| 2320 | }else if( !isSpecialTag && zBranchName && |
| 2321 | strcmp(&zTagName[4], zBranchName)==0){ |
| 2322 | continue; |
| 2323 | } |
| 2324 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2325 | @ <br /><label> |
| 2326 | if( P(zLabel) ){ |
| @@ -2368,11 +2368,11 @@ | |
| 2368 | @ as "closed" so that its leafs no longer appear on the "leaves" page |
| 2369 | @ and are no longer labeled as a leaf "<b>Leaf</b>"</label> |
| 2370 | @ </td></tr> |
| 2371 | } |
| 2372 | } |
| 2373 | if(zBranchName) fossil_free(zBranchName); |
| 2374 | |
| 2375 | |
| 2376 | @ <tr><td colspan="2"> |
| 2377 | @ <input type="submit" name="preview" value="Preview" /> |
| 2378 | @ <input type="submit" name="apply" value="Apply Changes" /> |
| 2379 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1770,11 +1770,11 @@ | |
| 1770 | if( modPending ){ |
| 1771 | @ <span class="modpending">*** Awaiting Moderator Approval ***</span> |
| 1772 | } |
| 1773 | @ <tr><th>Ticket:</th> |
| 1774 | @ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a> |
| 1775 | if( zTktTitle ){ |
| 1776 | @<br>%h(zTktTitle) |
| 1777 | } |
| 1778 | @</td></tr> |
| 1779 | @ <tr><th>Date:</th><td> |
| 1780 | hyperlink_to_date(zDate, "</td></tr>"); |
| @@ -2295,10 +2295,13 @@ | |
| 2295 | @ <td valign="top"> |
| 2296 | @ <label><input type="checkbox" id="newtag" name="newtag"%s(zNewTagFlag) /> |
| 2297 | @ Add the following new tag name to this check-in:</label> |
| 2298 | @ <input type="text" style="width:15;" name="tagname" value="%h(zNewTag)" |
| 2299 | @ onkeyup="gebi('newtag').checked=!!this.value" /> |
| 2300 | zBranchName = db_text(0, "SELECT value FROM tagxref, tag" |
| 2301 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2302 | " AND tagxref.tagid=%d", rid, TAG_BRANCH); |
| 2303 | db_prepare(&q, |
| 2304 | "SELECT tag.tagid, tagname, tagxref.value FROM tagxref, tag" |
| 2305 | " WHERE tagxref.rid=%d AND tagtype>0 AND tagxref.tagid=tag.tagid" |
| 2306 | " ORDER BY CASE WHEN tagname GLOB 'sym-*' THEN substr(tagname,5)" |
| 2307 | " ELSE tagname END /*sort*/", |
| @@ -2305,22 +2308,19 @@ | |
| 2308 | rid |
| 2309 | ); |
| 2310 | while( db_step(&q)==SQLITE_ROW ){ |
| 2311 | int tagid = db_column_int(&q, 0); |
| 2312 | const char *zTagName = db_column_text(&q, 1); |
| 2313 | int isSpecialTag = fossil_strncmp(zTagName, "sym-", 4)!=0; |
| 2314 | char zLabel[30]; |
| 2315 | |
| 2316 | if( tagid == TAG_CLOSED ){ |
| 2317 | fHasClosed = 1; |
| 2318 | }else if( (tagid == TAG_COMMENT) || (tagid == TAG_BRANCH) ){ |
| 2319 | continue; |
| 2320 | }else if( !isSpecialTag && zTagName && |
| 2321 | fossil_strcmp(&zTagName[4], zBranchName)==0){ |
| 2322 | continue; |
| 2323 | } |
| 2324 | sqlite3_snprintf(sizeof(zLabel), zLabel, "c%d", tagid); |
| 2325 | @ <br /><label> |
| 2326 | if( P(zLabel) ){ |
| @@ -2368,11 +2368,11 @@ | |
| 2368 | @ as "closed" so that its leafs no longer appear on the "leaves" page |
| 2369 | @ and are no longer labeled as a leaf "<b>Leaf</b>"</label> |
| 2370 | @ </td></tr> |
| 2371 | } |
| 2372 | } |
| 2373 | if( zBranchName ) fossil_free(zBranchName); |
| 2374 | |
| 2375 | |
| 2376 | @ <tr><td colspan="2"> |
| 2377 | @ <input type="submit" name="preview" value="Preview" /> |
| 2378 | @ <input type="submit" name="apply" value="Apply Changes" /> |
| 2379 |
+1
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -398,10 +398,11 @@ | ||
| 398 | 398 | if( strncmp(zAgent, "Mozilla/", 8)==0 ){ |
| 399 | 399 | if( atoi(&zAgent[8])<4 ) return 0; /* Many bots advertise as Mozilla/3 */ |
| 400 | 400 | if( strglob("*Firefox/[1-9]*", zAgent) ) return 1; |
| 401 | 401 | if( strglob("*Chrome/[1-9]*", zAgent) ) return 1; |
| 402 | 402 | if( strglob("*(compatible;?MSIE?[1789]*", zAgent) ) return 1; |
| 403 | + if( strglob("*Trident/[1-9]*;?rv:[1-9]*", zAgent) ) return 1; /* IE11+ */ | |
| 403 | 404 | if( strglob("*AppleWebKit/[1-9]*(KHTML*", zAgent) ) return 1; |
| 404 | 405 | return 0; |
| 405 | 406 | } |
| 406 | 407 | if( strncmp(zAgent, "Opera/", 6)==0 ) return 1; |
| 407 | 408 | if( strncmp(zAgent, "Safari/", 7)==0 ) return 1; |
| 408 | 409 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -398,10 +398,11 @@ | |
| 398 | if( strncmp(zAgent, "Mozilla/", 8)==0 ){ |
| 399 | if( atoi(&zAgent[8])<4 ) return 0; /* Many bots advertise as Mozilla/3 */ |
| 400 | if( strglob("*Firefox/[1-9]*", zAgent) ) return 1; |
| 401 | if( strglob("*Chrome/[1-9]*", zAgent) ) return 1; |
| 402 | if( strglob("*(compatible;?MSIE?[1789]*", zAgent) ) return 1; |
| 403 | if( strglob("*AppleWebKit/[1-9]*(KHTML*", zAgent) ) return 1; |
| 404 | return 0; |
| 405 | } |
| 406 | if( strncmp(zAgent, "Opera/", 6)==0 ) return 1; |
| 407 | if( strncmp(zAgent, "Safari/", 7)==0 ) return 1; |
| 408 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -398,10 +398,11 @@ | |
| 398 | if( strncmp(zAgent, "Mozilla/", 8)==0 ){ |
| 399 | if( atoi(&zAgent[8])<4 ) return 0; /* Many bots advertise as Mozilla/3 */ |
| 400 | if( strglob("*Firefox/[1-9]*", zAgent) ) return 1; |
| 401 | if( strglob("*Chrome/[1-9]*", zAgent) ) return 1; |
| 402 | if( strglob("*(compatible;?MSIE?[1789]*", zAgent) ) return 1; |
| 403 | if( strglob("*Trident/[1-9]*;?rv:[1-9]*", zAgent) ) return 1; /* IE11+ */ |
| 404 | if( strglob("*AppleWebKit/[1-9]*(KHTML*", zAgent) ) return 1; |
| 405 | return 0; |
| 406 | } |
| 407 | if( strncmp(zAgent, "Opera/", 6)==0 ) return 1; |
| 408 | if( strncmp(zAgent, "Safari/", 7)==0 ) return 1; |
| 409 |
+44
-30
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -30807,10 +30807,11 @@ | ||
| 30807 | 30807 | #if SQLITE_OS_WIN /* This file is used for Windows only */ |
| 30808 | 30808 | |
| 30809 | 30809 | #ifdef __CYGWIN__ |
| 30810 | 30810 | # include <sys/cygwin.h> |
| 30811 | 30811 | # include <errno.h> /* amalgamator: keep */ |
| 30812 | +# include <limits.h> /* amalgamator: keep */ | |
| 30812 | 30813 | #endif |
| 30813 | 30814 | |
| 30814 | 30815 | /* |
| 30815 | 30816 | ** Include code that is common to all os_*.c files |
| 30816 | 30817 | */ |
| @@ -31035,11 +31036,12 @@ | ||
| 31035 | 31036 | |
| 31036 | 31037 | /* |
| 31037 | 31038 | ** Are most of the Win32 ANSI APIs available (i.e. with certain exceptions |
| 31038 | 31039 | ** based on the sub-platform)? |
| 31039 | 31040 | */ |
| 31040 | -#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(SQLITE_WIN32_NO_ANSI) | |
| 31041 | +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(SQLITE_WIN32_NO_ANSI) \ | |
| 31042 | + && !defined(_WIN64) && !defined(__x86_64__) && !defined(__CYGWIN__) | |
| 31041 | 31043 | # define SQLITE_WIN32_HAS_ANSI |
| 31042 | 31044 | #endif |
| 31043 | 31045 | |
| 31044 | 31046 | /* |
| 31045 | 31047 | ** Are most of the Win32 Unicode APIs available (i.e. with certain exceptions |
| @@ -31111,11 +31113,15 @@ | ||
| 31111 | 31113 | /* |
| 31112 | 31114 | ** Maximum pathname length (in chars) for WinNT. This should normally be |
| 31113 | 31115 | ** UNICODE_STRING_MAX_CHARS. |
| 31114 | 31116 | */ |
| 31115 | 31117 | #ifndef SQLITE_WINNT_MAX_PATH_CHARS |
| 31116 | -# define SQLITE_WINNT_MAX_PATH_CHARS (UNICODE_STRING_MAX_CHARS) | |
| 31118 | +# ifdef __CYGWIN__ | |
| 31119 | +# define SQLITE_WINNT_MAX_PATH_CHARS (PATH_MAX) | |
| 31120 | +# else | |
| 31121 | +# define SQLITE_WINNT_MAX_PATH_CHARS (UNICODE_STRING_MAX_CHARS) | |
| 31122 | +# endif | |
| 31117 | 31123 | #endif |
| 31118 | 31124 | |
| 31119 | 31125 | /* |
| 31120 | 31126 | ** Maximum pathname length (in bytes) for Win32. The MAX_PATH macro is in |
| 31121 | 31127 | ** characters, so we allocate 4 bytes per character assuming worst-case of |
| @@ -35125,12 +35131,14 @@ | ||
| 35125 | 35131 | |
| 35126 | 35132 | /* |
| 35127 | 35133 | ** Convert a UTF-8 filename into whatever form the underlying |
| 35128 | 35134 | ** operating system wants filenames in. Space to hold the result |
| 35129 | 35135 | ** is obtained from malloc and must be freed by the calling |
| 35130 | -** function. When running on NT and zFilename is absolute, the | |
| 35131 | -** resulting path is guaranteed to start with "\\?\". | |
| 35136 | +** function. When running on NT, | |
| 35137 | +** the resulting path >= 260 chars and zFilename is absolute, | |
| 35138 | +** "\\?\" will be added in front the path: No Win32 API function | |
| 35139 | +** accepts such long paths without this prefix. | |
| 35132 | 35140 | */ |
| 35133 | 35141 | static void *winConvertFromUtf8Filename(const char *zFilename){ |
| 35134 | 35142 | void *zConverted = 0; |
| 35135 | 35143 | if( osIsNT() ){ |
| 35136 | 35144 | int nChar; |
| @@ -35138,29 +35146,44 @@ | ||
| 35138 | 35146 | |
| 35139 | 35147 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0); |
| 35140 | 35148 | if( nChar==0 ){ |
| 35141 | 35149 | return 0; |
| 35142 | 35150 | } |
| 35143 | - zWideFilename = sqlite3MallocZero( (nChar*sizeof(zWideFilename[0]))+12 ); | |
| 35151 | + if( nChar>=SQLITE_WIN32_MAX_PATH_CHARS ){ | |
| 35152 | + /* No Win32 API functions can handle such long paths. Let's see if | |
| 35153 | + * we can do something about it. If not, just leave it as is. */ | |
| 35154 | + if( winIsDirSep(zFilename[0]) && winIsDirSep(zFilename[1]) | |
| 35155 | + && zFilename[2]!='?' ){ | |
| 35156 | + /* It's an UNC path, convert it to an extended UNC path. */ | |
| 35157 | + zWideFilename = sqlite3MallocZero( (nChar+6)*sizeof(WCHAR) ); | |
| 35158 | + if( !zWideFilename ){ | |
| 35159 | + memcpy(zWideFilename, L"\\\\?\\UNC\\", 16); | |
| 35160 | + nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename+2, -1, | |
| 35161 | + zWideFilename+8, nChar); | |
| 35162 | + } | |
| 35163 | + return zWideFilename; | |
| 35164 | + }else if( winIsDriveLetterAndColon(zFilename) | |
| 35165 | + && winIsDirSep(zFilename[2]) ){ | |
| 35166 | + /* It has a correct drive prefix, convert to extended form. */ | |
| 35167 | + zWideFilename = sqlite3MallocZero( (nChar+4)*sizeof(WCHAR) ); | |
| 35168 | + if( !zWideFilename ){ | |
| 35169 | + memcpy(zWideFilename, L"\\\\?\\", 8); | |
| 35170 | + nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, | |
| 35171 | + zWideFilename+4, nChar); | |
| 35172 | + zWideFilename[6] = '\\'; | |
| 35173 | + } | |
| 35174 | + return zWideFilename; | |
| 35175 | + } | |
| 35176 | + /* Another form, e.g. relative path or maybe it already | |
| 35177 | + * has the '\\?\' prefix. Just leave it as-is. */ | |
| 35178 | + } | |
| 35179 | + zWideFilename = sqlite3MallocZero( nChar*sizeof(WCHAR) ); | |
| 35144 | 35180 | if( zWideFilename==0 ){ |
| 35145 | 35181 | return 0; |
| 35146 | 35182 | } |
| 35147 | - if( winIsDirSep(zFilename[0]) && winIsDirSep(zFilename[1]) | |
| 35148 | - && zFilename[2]!='?' ){ | |
| 35149 | - memcpy(zWideFilename, L"\\\\?\\UNC\\", 16); | |
| 35150 | - nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename+2, -1, | |
| 35151 | - zWideFilename+8, nChar); | |
| 35152 | - }else if( winIsDriveLetterAndColon(zFilename) | |
| 35153 | - && winIsDirSep(zFilename[2]) ){ | |
| 35154 | - memcpy(zWideFilename, L"\\\\?\\", 8); | |
| 35155 | - nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, | |
| 35156 | - zWideFilename+4, nChar); | |
| 35157 | - zWideFilename[6] = '\\'; | |
| 35158 | - }else{ | |
| 35159 | - nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, | |
| 35160 | - zWideFilename, nChar); | |
| 35161 | - } | |
| 35183 | + nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, | |
| 35184 | + zWideFilename, nChar); | |
| 35162 | 35185 | if( nChar==0 ){ |
| 35163 | 35186 | sqlite3_free(zWideFilename); |
| 35164 | 35187 | zWideFilename = 0; |
| 35165 | 35188 | } |
| 35166 | 35189 | zConverted = zWideFilename; |
| @@ -36118,20 +36141,11 @@ | ||
| 36118 | 36141 | sqlite3_free(zTemp); |
| 36119 | 36142 | return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(), |
| 36120 | 36143 | "winFullPathname2", zRelative); |
| 36121 | 36144 | } |
| 36122 | 36145 | sqlite3_free(zConverted); |
| 36123 | - if( memcmp(zTemp, L"\\\\?\\", 8)==0 ){ | |
| 36124 | - if( memcmp(zTemp+4, L"UNC\\", 8) ){ | |
| 36125 | - zTemp[6] = '\\'; | |
| 36126 | - zOut = winUnicodeToUtf8(zTemp+6); | |
| 36127 | - }else{ | |
| 36128 | - zOut = winUnicodeToUtf8(zTemp+4); | |
| 36129 | - } | |
| 36130 | - }else{ | |
| 36131 | - zOut = winUnicodeToUtf8(zTemp); | |
| 36132 | - } | |
| 36146 | + zOut = winUnicodeToUtf8(zTemp); | |
| 36133 | 36147 | sqlite3_free(zTemp); |
| 36134 | 36148 | } |
| 36135 | 36149 | #ifdef SQLITE_WIN32_HAS_ANSI |
| 36136 | 36150 | else{ |
| 36137 | 36151 | char *zTemp; |
| 36138 | 36152 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -30807,10 +30807,11 @@ | |
| 30807 | #if SQLITE_OS_WIN /* This file is used for Windows only */ |
| 30808 | |
| 30809 | #ifdef __CYGWIN__ |
| 30810 | # include <sys/cygwin.h> |
| 30811 | # include <errno.h> /* amalgamator: keep */ |
| 30812 | #endif |
| 30813 | |
| 30814 | /* |
| 30815 | ** Include code that is common to all os_*.c files |
| 30816 | */ |
| @@ -31035,11 +31036,12 @@ | |
| 31035 | |
| 31036 | /* |
| 31037 | ** Are most of the Win32 ANSI APIs available (i.e. with certain exceptions |
| 31038 | ** based on the sub-platform)? |
| 31039 | */ |
| 31040 | #if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(SQLITE_WIN32_NO_ANSI) |
| 31041 | # define SQLITE_WIN32_HAS_ANSI |
| 31042 | #endif |
| 31043 | |
| 31044 | /* |
| 31045 | ** Are most of the Win32 Unicode APIs available (i.e. with certain exceptions |
| @@ -31111,11 +31113,15 @@ | |
| 31111 | /* |
| 31112 | ** Maximum pathname length (in chars) for WinNT. This should normally be |
| 31113 | ** UNICODE_STRING_MAX_CHARS. |
| 31114 | */ |
| 31115 | #ifndef SQLITE_WINNT_MAX_PATH_CHARS |
| 31116 | # define SQLITE_WINNT_MAX_PATH_CHARS (UNICODE_STRING_MAX_CHARS) |
| 31117 | #endif |
| 31118 | |
| 31119 | /* |
| 31120 | ** Maximum pathname length (in bytes) for Win32. The MAX_PATH macro is in |
| 31121 | ** characters, so we allocate 4 bytes per character assuming worst-case of |
| @@ -35125,12 +35131,14 @@ | |
| 35125 | |
| 35126 | /* |
| 35127 | ** Convert a UTF-8 filename into whatever form the underlying |
| 35128 | ** operating system wants filenames in. Space to hold the result |
| 35129 | ** is obtained from malloc and must be freed by the calling |
| 35130 | ** function. When running on NT and zFilename is absolute, the |
| 35131 | ** resulting path is guaranteed to start with "\\?\". |
| 35132 | */ |
| 35133 | static void *winConvertFromUtf8Filename(const char *zFilename){ |
| 35134 | void *zConverted = 0; |
| 35135 | if( osIsNT() ){ |
| 35136 | int nChar; |
| @@ -35138,29 +35146,44 @@ | |
| 35138 | |
| 35139 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0); |
| 35140 | if( nChar==0 ){ |
| 35141 | return 0; |
| 35142 | } |
| 35143 | zWideFilename = sqlite3MallocZero( (nChar*sizeof(zWideFilename[0]))+12 ); |
| 35144 | if( zWideFilename==0 ){ |
| 35145 | return 0; |
| 35146 | } |
| 35147 | if( winIsDirSep(zFilename[0]) && winIsDirSep(zFilename[1]) |
| 35148 | && zFilename[2]!='?' ){ |
| 35149 | memcpy(zWideFilename, L"\\\\?\\UNC\\", 16); |
| 35150 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename+2, -1, |
| 35151 | zWideFilename+8, nChar); |
| 35152 | }else if( winIsDriveLetterAndColon(zFilename) |
| 35153 | && winIsDirSep(zFilename[2]) ){ |
| 35154 | memcpy(zWideFilename, L"\\\\?\\", 8); |
| 35155 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, |
| 35156 | zWideFilename+4, nChar); |
| 35157 | zWideFilename[6] = '\\'; |
| 35158 | }else{ |
| 35159 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, |
| 35160 | zWideFilename, nChar); |
| 35161 | } |
| 35162 | if( nChar==0 ){ |
| 35163 | sqlite3_free(zWideFilename); |
| 35164 | zWideFilename = 0; |
| 35165 | } |
| 35166 | zConverted = zWideFilename; |
| @@ -36118,20 +36141,11 @@ | |
| 36118 | sqlite3_free(zTemp); |
| 36119 | return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(), |
| 36120 | "winFullPathname2", zRelative); |
| 36121 | } |
| 36122 | sqlite3_free(zConverted); |
| 36123 | if( memcmp(zTemp, L"\\\\?\\", 8)==0 ){ |
| 36124 | if( memcmp(zTemp+4, L"UNC\\", 8) ){ |
| 36125 | zTemp[6] = '\\'; |
| 36126 | zOut = winUnicodeToUtf8(zTemp+6); |
| 36127 | }else{ |
| 36128 | zOut = winUnicodeToUtf8(zTemp+4); |
| 36129 | } |
| 36130 | }else{ |
| 36131 | zOut = winUnicodeToUtf8(zTemp); |
| 36132 | } |
| 36133 | sqlite3_free(zTemp); |
| 36134 | } |
| 36135 | #ifdef SQLITE_WIN32_HAS_ANSI |
| 36136 | else{ |
| 36137 | char *zTemp; |
| 36138 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -30807,10 +30807,11 @@ | |
| 30807 | #if SQLITE_OS_WIN /* This file is used for Windows only */ |
| 30808 | |
| 30809 | #ifdef __CYGWIN__ |
| 30810 | # include <sys/cygwin.h> |
| 30811 | # include <errno.h> /* amalgamator: keep */ |
| 30812 | # include <limits.h> /* amalgamator: keep */ |
| 30813 | #endif |
| 30814 | |
| 30815 | /* |
| 30816 | ** Include code that is common to all os_*.c files |
| 30817 | */ |
| @@ -31035,11 +31036,12 @@ | |
| 31036 | |
| 31037 | /* |
| 31038 | ** Are most of the Win32 ANSI APIs available (i.e. with certain exceptions |
| 31039 | ** based on the sub-platform)? |
| 31040 | */ |
| 31041 | #if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(SQLITE_WIN32_NO_ANSI) \ |
| 31042 | && !defined(_WIN64) && !defined(__x86_64__) && !defined(__CYGWIN__) |
| 31043 | # define SQLITE_WIN32_HAS_ANSI |
| 31044 | #endif |
| 31045 | |
| 31046 | /* |
| 31047 | ** Are most of the Win32 Unicode APIs available (i.e. with certain exceptions |
| @@ -31111,11 +31113,15 @@ | |
| 31113 | /* |
| 31114 | ** Maximum pathname length (in chars) for WinNT. This should normally be |
| 31115 | ** UNICODE_STRING_MAX_CHARS. |
| 31116 | */ |
| 31117 | #ifndef SQLITE_WINNT_MAX_PATH_CHARS |
| 31118 | # ifdef __CYGWIN__ |
| 31119 | # define SQLITE_WINNT_MAX_PATH_CHARS (PATH_MAX) |
| 31120 | # else |
| 31121 | # define SQLITE_WINNT_MAX_PATH_CHARS (UNICODE_STRING_MAX_CHARS) |
| 31122 | # endif |
| 31123 | #endif |
| 31124 | |
| 31125 | /* |
| 31126 | ** Maximum pathname length (in bytes) for Win32. The MAX_PATH macro is in |
| 31127 | ** characters, so we allocate 4 bytes per character assuming worst-case of |
| @@ -35125,12 +35131,14 @@ | |
| 35131 | |
| 35132 | /* |
| 35133 | ** Convert a UTF-8 filename into whatever form the underlying |
| 35134 | ** operating system wants filenames in. Space to hold the result |
| 35135 | ** is obtained from malloc and must be freed by the calling |
| 35136 | ** function. When running on NT, |
| 35137 | ** the resulting path >= 260 chars and zFilename is absolute, |
| 35138 | ** "\\?\" will be added in front the path: No Win32 API function |
| 35139 | ** accepts such long paths without this prefix. |
| 35140 | */ |
| 35141 | static void *winConvertFromUtf8Filename(const char *zFilename){ |
| 35142 | void *zConverted = 0; |
| 35143 | if( osIsNT() ){ |
| 35144 | int nChar; |
| @@ -35138,29 +35146,44 @@ | |
| 35146 | |
| 35147 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0); |
| 35148 | if( nChar==0 ){ |
| 35149 | return 0; |
| 35150 | } |
| 35151 | if( nChar>=SQLITE_WIN32_MAX_PATH_CHARS ){ |
| 35152 | /* No Win32 API functions can handle such long paths. Let's see if |
| 35153 | * we can do something about it. If not, just leave it as is. */ |
| 35154 | if( winIsDirSep(zFilename[0]) && winIsDirSep(zFilename[1]) |
| 35155 | && zFilename[2]!='?' ){ |
| 35156 | /* It's an UNC path, convert it to an extended UNC path. */ |
| 35157 | zWideFilename = sqlite3MallocZero( (nChar+6)*sizeof(WCHAR) ); |
| 35158 | if( !zWideFilename ){ |
| 35159 | memcpy(zWideFilename, L"\\\\?\\UNC\\", 16); |
| 35160 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename+2, -1, |
| 35161 | zWideFilename+8, nChar); |
| 35162 | } |
| 35163 | return zWideFilename; |
| 35164 | }else if( winIsDriveLetterAndColon(zFilename) |
| 35165 | && winIsDirSep(zFilename[2]) ){ |
| 35166 | /* It has a correct drive prefix, convert to extended form. */ |
| 35167 | zWideFilename = sqlite3MallocZero( (nChar+4)*sizeof(WCHAR) ); |
| 35168 | if( !zWideFilename ){ |
| 35169 | memcpy(zWideFilename, L"\\\\?\\", 8); |
| 35170 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, |
| 35171 | zWideFilename+4, nChar); |
| 35172 | zWideFilename[6] = '\\'; |
| 35173 | } |
| 35174 | return zWideFilename; |
| 35175 | } |
| 35176 | /* Another form, e.g. relative path or maybe it already |
| 35177 | * has the '\\?\' prefix. Just leave it as-is. */ |
| 35178 | } |
| 35179 | zWideFilename = sqlite3MallocZero( nChar*sizeof(WCHAR) ); |
| 35180 | if( zWideFilename==0 ){ |
| 35181 | return 0; |
| 35182 | } |
| 35183 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, |
| 35184 | zWideFilename, nChar); |
| 35185 | if( nChar==0 ){ |
| 35186 | sqlite3_free(zWideFilename); |
| 35187 | zWideFilename = 0; |
| 35188 | } |
| 35189 | zConverted = zWideFilename; |
| @@ -36118,20 +36141,11 @@ | |
| 36141 | sqlite3_free(zTemp); |
| 36142 | return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(), |
| 36143 | "winFullPathname2", zRelative); |
| 36144 | } |
| 36145 | sqlite3_free(zConverted); |
| 36146 | zOut = winUnicodeToUtf8(zTemp); |
| 36147 | sqlite3_free(zTemp); |
| 36148 | } |
| 36149 | #ifdef SQLITE_WIN32_HAS_ANSI |
| 36150 | else{ |
| 36151 | char *zTemp; |
| 36152 |
+44
-30
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -30807,10 +30807,11 @@ | ||
| 30807 | 30807 | #if SQLITE_OS_WIN /* This file is used for Windows only */ |
| 30808 | 30808 | |
| 30809 | 30809 | #ifdef __CYGWIN__ |
| 30810 | 30810 | # include <sys/cygwin.h> |
| 30811 | 30811 | # include <errno.h> /* amalgamator: keep */ |
| 30812 | +# include <limits.h> /* amalgamator: keep */ | |
| 30812 | 30813 | #endif |
| 30813 | 30814 | |
| 30814 | 30815 | /* |
| 30815 | 30816 | ** Include code that is common to all os_*.c files |
| 30816 | 30817 | */ |
| @@ -31035,11 +31036,12 @@ | ||
| 31035 | 31036 | |
| 31036 | 31037 | /* |
| 31037 | 31038 | ** Are most of the Win32 ANSI APIs available (i.e. with certain exceptions |
| 31038 | 31039 | ** based on the sub-platform)? |
| 31039 | 31040 | */ |
| 31040 | -#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(SQLITE_WIN32_NO_ANSI) | |
| 31041 | +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(SQLITE_WIN32_NO_ANSI) \ | |
| 31042 | + && !defined(_WIN64) && !defined(__x86_64__) && !defined(__CYGWIN__) | |
| 31041 | 31043 | # define SQLITE_WIN32_HAS_ANSI |
| 31042 | 31044 | #endif |
| 31043 | 31045 | |
| 31044 | 31046 | /* |
| 31045 | 31047 | ** Are most of the Win32 Unicode APIs available (i.e. with certain exceptions |
| @@ -31111,11 +31113,15 @@ | ||
| 31111 | 31113 | /* |
| 31112 | 31114 | ** Maximum pathname length (in chars) for WinNT. This should normally be |
| 31113 | 31115 | ** UNICODE_STRING_MAX_CHARS. |
| 31114 | 31116 | */ |
| 31115 | 31117 | #ifndef SQLITE_WINNT_MAX_PATH_CHARS |
| 31116 | -# define SQLITE_WINNT_MAX_PATH_CHARS (UNICODE_STRING_MAX_CHARS) | |
| 31118 | +# ifdef __CYGWIN__ | |
| 31119 | +# define SQLITE_WINNT_MAX_PATH_CHARS (PATH_MAX) | |
| 31120 | +# else | |
| 31121 | +# define SQLITE_WINNT_MAX_PATH_CHARS (UNICODE_STRING_MAX_CHARS) | |
| 31122 | +# endif | |
| 31117 | 31123 | #endif |
| 31118 | 31124 | |
| 31119 | 31125 | /* |
| 31120 | 31126 | ** Maximum pathname length (in bytes) for Win32. The MAX_PATH macro is in |
| 31121 | 31127 | ** characters, so we allocate 4 bytes per character assuming worst-case of |
| @@ -35125,12 +35131,14 @@ | ||
| 35125 | 35131 | |
| 35126 | 35132 | /* |
| 35127 | 35133 | ** Convert a UTF-8 filename into whatever form the underlying |
| 35128 | 35134 | ** operating system wants filenames in. Space to hold the result |
| 35129 | 35135 | ** is obtained from malloc and must be freed by the calling |
| 35130 | -** function. When running on NT and zFilename is absolute, the | |
| 35131 | -** resulting path is guaranteed to start with "\\?\". | |
| 35136 | +** function. When running on NT, | |
| 35137 | +** the resulting path >= 260 chars and zFilename is absolute, | |
| 35138 | +** "\\?\" will be added in front the path: No Win32 API function | |
| 35139 | +** accepts such long paths without this prefix. | |
| 35132 | 35140 | */ |
| 35133 | 35141 | static void *winConvertFromUtf8Filename(const char *zFilename){ |
| 35134 | 35142 | void *zConverted = 0; |
| 35135 | 35143 | if( osIsNT() ){ |
| 35136 | 35144 | int nChar; |
| @@ -35138,29 +35146,44 @@ | ||
| 35138 | 35146 | |
| 35139 | 35147 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0); |
| 35140 | 35148 | if( nChar==0 ){ |
| 35141 | 35149 | return 0; |
| 35142 | 35150 | } |
| 35143 | - zWideFilename = sqlite3MallocZero( (nChar*sizeof(zWideFilename[0]))+12 ); | |
| 35151 | + if( nChar>=SQLITE_WIN32_MAX_PATH_CHARS ){ | |
| 35152 | + /* No Win32 API functions can handle such long paths. Let's see if | |
| 35153 | + * we can do something about it. If not, just leave it as is. */ | |
| 35154 | + if( winIsDirSep(zFilename[0]) && winIsDirSep(zFilename[1]) | |
| 35155 | + && zFilename[2]!='?' ){ | |
| 35156 | + /* It's an UNC path, convert it to an extended UNC path. */ | |
| 35157 | + zWideFilename = sqlite3MallocZero( (nChar+6)*sizeof(WCHAR) ); | |
| 35158 | + if( !zWideFilename ){ | |
| 35159 | + memcpy(zWideFilename, L"\\\\?\\UNC\\", 16); | |
| 35160 | + nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename+2, -1, | |
| 35161 | + zWideFilename+8, nChar); | |
| 35162 | + } | |
| 35163 | + return zWideFilename; | |
| 35164 | + }else if( winIsDriveLetterAndColon(zFilename) | |
| 35165 | + && winIsDirSep(zFilename[2]) ){ | |
| 35166 | + /* It has a correct drive prefix, convert to extended form. */ | |
| 35167 | + zWideFilename = sqlite3MallocZero( (nChar+4)*sizeof(WCHAR) ); | |
| 35168 | + if( !zWideFilename ){ | |
| 35169 | + memcpy(zWideFilename, L"\\\\?\\", 8); | |
| 35170 | + nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, | |
| 35171 | + zWideFilename+4, nChar); | |
| 35172 | + zWideFilename[6] = '\\'; | |
| 35173 | + } | |
| 35174 | + return zWideFilename; | |
| 35175 | + } | |
| 35176 | + /* Another form, e.g. relative path or maybe it already | |
| 35177 | + * has the '\\?\' prefix. Just leave it as-is. */ | |
| 35178 | + } | |
| 35179 | + zWideFilename = sqlite3MallocZero( nChar*sizeof(WCHAR) ); | |
| 35144 | 35180 | if( zWideFilename==0 ){ |
| 35145 | 35181 | return 0; |
| 35146 | 35182 | } |
| 35147 | - if( winIsDirSep(zFilename[0]) && winIsDirSep(zFilename[1]) | |
| 35148 | - && zFilename[2]!='?' ){ | |
| 35149 | - memcpy(zWideFilename, L"\\\\?\\UNC\\", 16); | |
| 35150 | - nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename+2, -1, | |
| 35151 | - zWideFilename+8, nChar); | |
| 35152 | - }else if( winIsDriveLetterAndColon(zFilename) | |
| 35153 | - && winIsDirSep(zFilename[2]) ){ | |
| 35154 | - memcpy(zWideFilename, L"\\\\?\\", 8); | |
| 35155 | - nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, | |
| 35156 | - zWideFilename+4, nChar); | |
| 35157 | - zWideFilename[6] = '\\'; | |
| 35158 | - }else{ | |
| 35159 | - nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, | |
| 35160 | - zWideFilename, nChar); | |
| 35161 | - } | |
| 35183 | + nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, | |
| 35184 | + zWideFilename, nChar); | |
| 35162 | 35185 | if( nChar==0 ){ |
| 35163 | 35186 | sqlite3_free(zWideFilename); |
| 35164 | 35187 | zWideFilename = 0; |
| 35165 | 35188 | } |
| 35166 | 35189 | zConverted = zWideFilename; |
| @@ -36118,20 +36141,11 @@ | ||
| 36118 | 36141 | sqlite3_free(zTemp); |
| 36119 | 36142 | return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(), |
| 36120 | 36143 | "winFullPathname2", zRelative); |
| 36121 | 36144 | } |
| 36122 | 36145 | sqlite3_free(zConverted); |
| 36123 | - if( memcmp(zTemp, L"\\\\?\\", 8)==0 ){ | |
| 36124 | - if( memcmp(zTemp+4, L"UNC\\", 8) ){ | |
| 36125 | - zTemp[6] = '\\'; | |
| 36126 | - zOut = winUnicodeToUtf8(zTemp+6); | |
| 36127 | - }else{ | |
| 36128 | - zOut = winUnicodeToUtf8(zTemp+4); | |
| 36129 | - } | |
| 36130 | - }else{ | |
| 36131 | - zOut = winUnicodeToUtf8(zTemp); | |
| 36132 | - } | |
| 36146 | + zOut = winUnicodeToUtf8(zTemp); | |
| 36133 | 36147 | sqlite3_free(zTemp); |
| 36134 | 36148 | } |
| 36135 | 36149 | #ifdef SQLITE_WIN32_HAS_ANSI |
| 36136 | 36150 | else{ |
| 36137 | 36151 | char *zTemp; |
| 36138 | 36152 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -30807,10 +30807,11 @@ | |
| 30807 | #if SQLITE_OS_WIN /* This file is used for Windows only */ |
| 30808 | |
| 30809 | #ifdef __CYGWIN__ |
| 30810 | # include <sys/cygwin.h> |
| 30811 | # include <errno.h> /* amalgamator: keep */ |
| 30812 | #endif |
| 30813 | |
| 30814 | /* |
| 30815 | ** Include code that is common to all os_*.c files |
| 30816 | */ |
| @@ -31035,11 +31036,12 @@ | |
| 31035 | |
| 31036 | /* |
| 31037 | ** Are most of the Win32 ANSI APIs available (i.e. with certain exceptions |
| 31038 | ** based on the sub-platform)? |
| 31039 | */ |
| 31040 | #if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(SQLITE_WIN32_NO_ANSI) |
| 31041 | # define SQLITE_WIN32_HAS_ANSI |
| 31042 | #endif |
| 31043 | |
| 31044 | /* |
| 31045 | ** Are most of the Win32 Unicode APIs available (i.e. with certain exceptions |
| @@ -31111,11 +31113,15 @@ | |
| 31111 | /* |
| 31112 | ** Maximum pathname length (in chars) for WinNT. This should normally be |
| 31113 | ** UNICODE_STRING_MAX_CHARS. |
| 31114 | */ |
| 31115 | #ifndef SQLITE_WINNT_MAX_PATH_CHARS |
| 31116 | # define SQLITE_WINNT_MAX_PATH_CHARS (UNICODE_STRING_MAX_CHARS) |
| 31117 | #endif |
| 31118 | |
| 31119 | /* |
| 31120 | ** Maximum pathname length (in bytes) for Win32. The MAX_PATH macro is in |
| 31121 | ** characters, so we allocate 4 bytes per character assuming worst-case of |
| @@ -35125,12 +35131,14 @@ | |
| 35125 | |
| 35126 | /* |
| 35127 | ** Convert a UTF-8 filename into whatever form the underlying |
| 35128 | ** operating system wants filenames in. Space to hold the result |
| 35129 | ** is obtained from malloc and must be freed by the calling |
| 35130 | ** function. When running on NT and zFilename is absolute, the |
| 35131 | ** resulting path is guaranteed to start with "\\?\". |
| 35132 | */ |
| 35133 | static void *winConvertFromUtf8Filename(const char *zFilename){ |
| 35134 | void *zConverted = 0; |
| 35135 | if( osIsNT() ){ |
| 35136 | int nChar; |
| @@ -35138,29 +35146,44 @@ | |
| 35138 | |
| 35139 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0); |
| 35140 | if( nChar==0 ){ |
| 35141 | return 0; |
| 35142 | } |
| 35143 | zWideFilename = sqlite3MallocZero( (nChar*sizeof(zWideFilename[0]))+12 ); |
| 35144 | if( zWideFilename==0 ){ |
| 35145 | return 0; |
| 35146 | } |
| 35147 | if( winIsDirSep(zFilename[0]) && winIsDirSep(zFilename[1]) |
| 35148 | && zFilename[2]!='?' ){ |
| 35149 | memcpy(zWideFilename, L"\\\\?\\UNC\\", 16); |
| 35150 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename+2, -1, |
| 35151 | zWideFilename+8, nChar); |
| 35152 | }else if( winIsDriveLetterAndColon(zFilename) |
| 35153 | && winIsDirSep(zFilename[2]) ){ |
| 35154 | memcpy(zWideFilename, L"\\\\?\\", 8); |
| 35155 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, |
| 35156 | zWideFilename+4, nChar); |
| 35157 | zWideFilename[6] = '\\'; |
| 35158 | }else{ |
| 35159 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, |
| 35160 | zWideFilename, nChar); |
| 35161 | } |
| 35162 | if( nChar==0 ){ |
| 35163 | sqlite3_free(zWideFilename); |
| 35164 | zWideFilename = 0; |
| 35165 | } |
| 35166 | zConverted = zWideFilename; |
| @@ -36118,20 +36141,11 @@ | |
| 36118 | sqlite3_free(zTemp); |
| 36119 | return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(), |
| 36120 | "winFullPathname2", zRelative); |
| 36121 | } |
| 36122 | sqlite3_free(zConverted); |
| 36123 | if( memcmp(zTemp, L"\\\\?\\", 8)==0 ){ |
| 36124 | if( memcmp(zTemp+4, L"UNC\\", 8) ){ |
| 36125 | zTemp[6] = '\\'; |
| 36126 | zOut = winUnicodeToUtf8(zTemp+6); |
| 36127 | }else{ |
| 36128 | zOut = winUnicodeToUtf8(zTemp+4); |
| 36129 | } |
| 36130 | }else{ |
| 36131 | zOut = winUnicodeToUtf8(zTemp); |
| 36132 | } |
| 36133 | sqlite3_free(zTemp); |
| 36134 | } |
| 36135 | #ifdef SQLITE_WIN32_HAS_ANSI |
| 36136 | else{ |
| 36137 | char *zTemp; |
| 36138 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -30807,10 +30807,11 @@ | |
| 30807 | #if SQLITE_OS_WIN /* This file is used for Windows only */ |
| 30808 | |
| 30809 | #ifdef __CYGWIN__ |
| 30810 | # include <sys/cygwin.h> |
| 30811 | # include <errno.h> /* amalgamator: keep */ |
| 30812 | # include <limits.h> /* amalgamator: keep */ |
| 30813 | #endif |
| 30814 | |
| 30815 | /* |
| 30816 | ** Include code that is common to all os_*.c files |
| 30817 | */ |
| @@ -31035,11 +31036,12 @@ | |
| 31036 | |
| 31037 | /* |
| 31038 | ** Are most of the Win32 ANSI APIs available (i.e. with certain exceptions |
| 31039 | ** based on the sub-platform)? |
| 31040 | */ |
| 31041 | #if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(SQLITE_WIN32_NO_ANSI) \ |
| 31042 | && !defined(_WIN64) && !defined(__x86_64__) && !defined(__CYGWIN__) |
| 31043 | # define SQLITE_WIN32_HAS_ANSI |
| 31044 | #endif |
| 31045 | |
| 31046 | /* |
| 31047 | ** Are most of the Win32 Unicode APIs available (i.e. with certain exceptions |
| @@ -31111,11 +31113,15 @@ | |
| 31113 | /* |
| 31114 | ** Maximum pathname length (in chars) for WinNT. This should normally be |
| 31115 | ** UNICODE_STRING_MAX_CHARS. |
| 31116 | */ |
| 31117 | #ifndef SQLITE_WINNT_MAX_PATH_CHARS |
| 31118 | # ifdef __CYGWIN__ |
| 31119 | # define SQLITE_WINNT_MAX_PATH_CHARS (PATH_MAX) |
| 31120 | # else |
| 31121 | # define SQLITE_WINNT_MAX_PATH_CHARS (UNICODE_STRING_MAX_CHARS) |
| 31122 | # endif |
| 31123 | #endif |
| 31124 | |
| 31125 | /* |
| 31126 | ** Maximum pathname length (in bytes) for Win32. The MAX_PATH macro is in |
| 31127 | ** characters, so we allocate 4 bytes per character assuming worst-case of |
| @@ -35125,12 +35131,14 @@ | |
| 35131 | |
| 35132 | /* |
| 35133 | ** Convert a UTF-8 filename into whatever form the underlying |
| 35134 | ** operating system wants filenames in. Space to hold the result |
| 35135 | ** is obtained from malloc and must be freed by the calling |
| 35136 | ** function. When running on NT, |
| 35137 | ** the resulting path >= 260 chars and zFilename is absolute, |
| 35138 | ** "\\?\" will be added in front the path: No Win32 API function |
| 35139 | ** accepts such long paths without this prefix. |
| 35140 | */ |
| 35141 | static void *winConvertFromUtf8Filename(const char *zFilename){ |
| 35142 | void *zConverted = 0; |
| 35143 | if( osIsNT() ){ |
| 35144 | int nChar; |
| @@ -35138,29 +35146,44 @@ | |
| 35146 | |
| 35147 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0); |
| 35148 | if( nChar==0 ){ |
| 35149 | return 0; |
| 35150 | } |
| 35151 | if( nChar>=SQLITE_WIN32_MAX_PATH_CHARS ){ |
| 35152 | /* No Win32 API functions can handle such long paths. Let's see if |
| 35153 | * we can do something about it. If not, just leave it as is. */ |
| 35154 | if( winIsDirSep(zFilename[0]) && winIsDirSep(zFilename[1]) |
| 35155 | && zFilename[2]!='?' ){ |
| 35156 | /* It's an UNC path, convert it to an extended UNC path. */ |
| 35157 | zWideFilename = sqlite3MallocZero( (nChar+6)*sizeof(WCHAR) ); |
| 35158 | if( !zWideFilename ){ |
| 35159 | memcpy(zWideFilename, L"\\\\?\\UNC\\", 16); |
| 35160 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename+2, -1, |
| 35161 | zWideFilename+8, nChar); |
| 35162 | } |
| 35163 | return zWideFilename; |
| 35164 | }else if( winIsDriveLetterAndColon(zFilename) |
| 35165 | && winIsDirSep(zFilename[2]) ){ |
| 35166 | /* It has a correct drive prefix, convert to extended form. */ |
| 35167 | zWideFilename = sqlite3MallocZero( (nChar+4)*sizeof(WCHAR) ); |
| 35168 | if( !zWideFilename ){ |
| 35169 | memcpy(zWideFilename, L"\\\\?\\", 8); |
| 35170 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, |
| 35171 | zWideFilename+4, nChar); |
| 35172 | zWideFilename[6] = '\\'; |
| 35173 | } |
| 35174 | return zWideFilename; |
| 35175 | } |
| 35176 | /* Another form, e.g. relative path or maybe it already |
| 35177 | * has the '\\?\' prefix. Just leave it as-is. */ |
| 35178 | } |
| 35179 | zWideFilename = sqlite3MallocZero( nChar*sizeof(WCHAR) ); |
| 35180 | if( zWideFilename==0 ){ |
| 35181 | return 0; |
| 35182 | } |
| 35183 | nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, |
| 35184 | zWideFilename, nChar); |
| 35185 | if( nChar==0 ){ |
| 35186 | sqlite3_free(zWideFilename); |
| 35187 | zWideFilename = 0; |
| 35188 | } |
| 35189 | zConverted = zWideFilename; |
| @@ -36118,20 +36141,11 @@ | |
| 36141 | sqlite3_free(zTemp); |
| 36142 | return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(), |
| 36143 | "winFullPathname2", zRelative); |
| 36144 | } |
| 36145 | sqlite3_free(zConverted); |
| 36146 | zOut = winUnicodeToUtf8(zTemp); |
| 36147 | sqlite3_free(zTemp); |
| 36148 | } |
| 36149 | #ifdef SQLITE_WIN32_HAS_ANSI |
| 36150 | else{ |
| 36151 | char *zTemp; |
| 36152 |
+4
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1121,10 +1121,11 @@ | ||
| 1121 | 1121 | tmFlags |= TIMELINE_BRCOLOR; |
| 1122 | 1122 | url_add_parameter(&url, "brbg", 0); |
| 1123 | 1123 | } |
| 1124 | 1124 | if( P("unhide")!=0 ){ |
| 1125 | 1125 | tmFlags |= TIMELINE_UNHIDE; |
| 1126 | + url_add_parameter(&url, "unhide", 0); | |
| 1126 | 1127 | } |
| 1127 | 1128 | if( P("ubg")!=0 ){ |
| 1128 | 1129 | tmFlags |= TIMELINE_UCOLOR; |
| 1129 | 1130 | url_add_parameter(&url, "ubg", 0); |
| 1130 | 1131 | } |
| @@ -1497,10 +1498,13 @@ | ||
| 1497 | 1498 | if( tmFlags & TIMELINE_FCHANGES ){ |
| 1498 | 1499 | timeline_submenu(&url, "Hide Files", "v", 0, 0); |
| 1499 | 1500 | }else{ |
| 1500 | 1501 | timeline_submenu(&url, "Show Files", "v", "", 0); |
| 1501 | 1502 | } |
| 1503 | + if( (tmFlags & TIMELINE_UNHIDE)==0 ){ | |
| 1504 | + timeline_submenu(&url, "Unhide", "unhide", "", 0); | |
| 1505 | + } | |
| 1502 | 1506 | } |
| 1503 | 1507 | } |
| 1504 | 1508 | } |
| 1505 | 1509 | if( P("showsql") ){ |
| 1506 | 1510 | @ <blockquote>%h(blob_str(&sql))</blockquote> |
| 1507 | 1511 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1121,10 +1121,11 @@ | |
| 1121 | tmFlags |= TIMELINE_BRCOLOR; |
| 1122 | url_add_parameter(&url, "brbg", 0); |
| 1123 | } |
| 1124 | if( P("unhide")!=0 ){ |
| 1125 | tmFlags |= TIMELINE_UNHIDE; |
| 1126 | } |
| 1127 | if( P("ubg")!=0 ){ |
| 1128 | tmFlags |= TIMELINE_UCOLOR; |
| 1129 | url_add_parameter(&url, "ubg", 0); |
| 1130 | } |
| @@ -1497,10 +1498,13 @@ | |
| 1497 | if( tmFlags & TIMELINE_FCHANGES ){ |
| 1498 | timeline_submenu(&url, "Hide Files", "v", 0, 0); |
| 1499 | }else{ |
| 1500 | timeline_submenu(&url, "Show Files", "v", "", 0); |
| 1501 | } |
| 1502 | } |
| 1503 | } |
| 1504 | } |
| 1505 | if( P("showsql") ){ |
| 1506 | @ <blockquote>%h(blob_str(&sql))</blockquote> |
| 1507 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1121,10 +1121,11 @@ | |
| 1121 | tmFlags |= TIMELINE_BRCOLOR; |
| 1122 | url_add_parameter(&url, "brbg", 0); |
| 1123 | } |
| 1124 | if( P("unhide")!=0 ){ |
| 1125 | tmFlags |= TIMELINE_UNHIDE; |
| 1126 | url_add_parameter(&url, "unhide", 0); |
| 1127 | } |
| 1128 | if( P("ubg")!=0 ){ |
| 1129 | tmFlags |= TIMELINE_UCOLOR; |
| 1130 | url_add_parameter(&url, "ubg", 0); |
| 1131 | } |
| @@ -1497,10 +1498,13 @@ | |
| 1498 | if( tmFlags & TIMELINE_FCHANGES ){ |
| 1499 | timeline_submenu(&url, "Hide Files", "v", 0, 0); |
| 1500 | }else{ |
| 1501 | timeline_submenu(&url, "Show Files", "v", "", 0); |
| 1502 | } |
| 1503 | if( (tmFlags & TIMELINE_UNHIDE)==0 ){ |
| 1504 | timeline_submenu(&url, "Unhide", "unhide", "", 0); |
| 1505 | } |
| 1506 | } |
| 1507 | } |
| 1508 | } |
| 1509 | if( P("showsql") ){ |
| 1510 | @ <blockquote>%h(blob_str(&sql))</blockquote> |
| 1511 |