Fossil SCM
strglob() -> sqlite3_strglob()
Commit
2271ea42fe35fee4afbc1980c5811c8d2c71c531
Parent
c7c54d29f0e99ba…
7 files changed
+1
-1
+2
-2
+3
-3
+5
-5
+1
-1
+2
-2
+1
-1
+1
-1
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -759,11 +759,11 @@ | ||
| 759 | 759 | db_prepare(&ins, |
| 760 | 760 | "INSERT INTO temp.fileage(fid, pathname)" |
| 761 | 761 | " SELECT rid, :path FROM blob WHERE uuid=:uuid" |
| 762 | 762 | ); |
| 763 | 763 | while( (pFile = manifest_file_next(pManifest, 0))!=0 ){ |
| 764 | - if(zGlob && !strglob(zGlob, pFile->zName)) continue; | |
| 764 | + if( zGlob && sqlite3_strglob(zGlob, pFile->zName)!=0 ) continue; | |
| 765 | 765 | db_bind_text(&ins, ":uuid", pFile->zUuid); |
| 766 | 766 | db_bind_text(&ins, ":path", pFile->zName); |
| 767 | 767 | db_step(&ins); |
| 768 | 768 | db_reset(&ins); |
| 769 | 769 | nFile++; |
| 770 | 770 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -759,11 +759,11 @@ | |
| 759 | db_prepare(&ins, |
| 760 | "INSERT INTO temp.fileage(fid, pathname)" |
| 761 | " SELECT rid, :path FROM blob WHERE uuid=:uuid" |
| 762 | ); |
| 763 | while( (pFile = manifest_file_next(pManifest, 0))!=0 ){ |
| 764 | if(zGlob && !strglob(zGlob, pFile->zName)) continue; |
| 765 | db_bind_text(&ins, ":uuid", pFile->zUuid); |
| 766 | db_bind_text(&ins, ":path", pFile->zName); |
| 767 | db_step(&ins); |
| 768 | db_reset(&ins); |
| 769 | nFile++; |
| 770 |
| --- src/browse.c | |
| +++ src/browse.c | |
| @@ -759,11 +759,11 @@ | |
| 759 | db_prepare(&ins, |
| 760 | "INSERT INTO temp.fileage(fid, pathname)" |
| 761 | " SELECT rid, :path FROM blob WHERE uuid=:uuid" |
| 762 | ); |
| 763 | while( (pFile = manifest_file_next(pManifest, 0))!=0 ){ |
| 764 | if( zGlob && sqlite3_strglob(zGlob, pFile->zName)!=0 ) continue; |
| 765 | db_bind_text(&ins, ":uuid", pFile->zUuid); |
| 766 | db_bind_text(&ins, ":path", pFile->zName); |
| 767 | db_step(&ins); |
| 768 | db_reset(&ins); |
| 769 | nFile++; |
| 770 |
+2
-2
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -277,12 +277,12 @@ | ||
| 277 | 277 | ** Return true if the response should be sent with Content-Encoding: gzip. |
| 278 | 278 | */ |
| 279 | 279 | static int is_gzippable(void){ |
| 280 | 280 | if( strstr(PD("HTTP_ACCEPT_ENCODING", ""), "gzip")==0 ) return 0; |
| 281 | 281 | return strncmp(zContentType, "text/", 5)==0 |
| 282 | - || strglob("application/*xml", zContentType) | |
| 283 | - || strglob("application/*javascript", zContentType); | |
| 282 | + || sqlite3_strglob("application/*xml", zContentType)==0 | |
| 283 | + || sqlite3_strglob("application/*javascript", zContentType)==0; | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /* |
| 287 | 287 | ** Do a normal HTTP reply |
| 288 | 288 | */ |
| 289 | 289 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -277,12 +277,12 @@ | |
| 277 | ** Return true if the response should be sent with Content-Encoding: gzip. |
| 278 | */ |
| 279 | static int is_gzippable(void){ |
| 280 | if( strstr(PD("HTTP_ACCEPT_ENCODING", ""), "gzip")==0 ) return 0; |
| 281 | return strncmp(zContentType, "text/", 5)==0 |
| 282 | || strglob("application/*xml", zContentType) |
| 283 | || strglob("application/*javascript", zContentType); |
| 284 | } |
| 285 | |
| 286 | /* |
| 287 | ** Do a normal HTTP reply |
| 288 | */ |
| 289 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -277,12 +277,12 @@ | |
| 277 | ** Return true if the response should be sent with Content-Encoding: gzip. |
| 278 | */ |
| 279 | static int is_gzippable(void){ |
| 280 | if( strstr(PD("HTTP_ACCEPT_ENCODING", ""), "gzip")==0 ) return 0; |
| 281 | return strncmp(zContentType, "text/", 5)==0 |
| 282 | || sqlite3_strglob("application/*xml", zContentType)==0 |
| 283 | || sqlite3_strglob("application/*javascript", zContentType)==0; |
| 284 | } |
| 285 | |
| 286 | /* |
| 287 | ** Do a normal HTTP reply |
| 288 | */ |
| 289 |
M
src/db.c
+3
-3
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -892,11 +892,11 @@ | ||
| 892 | 892 | " WHERE name=='%s' /*scan*/", |
| 893 | 893 | db_name("localdb"), zTable); |
| 894 | 894 | int rc = 0; |
| 895 | 895 | if( zDef ){ |
| 896 | 896 | char *zPattern = mprintf("* %s *", zColumn); |
| 897 | - rc = strglob(zPattern, zDef)==0; | |
| 897 | + rc = sqlite3_strglob(zPattern, zDef)!=0; | |
| 898 | 898 | fossil_free(zPattern); |
| 899 | 899 | fossil_free(zDef); |
| 900 | 900 | } |
| 901 | 901 | return rc; |
| 902 | 902 | } |
| @@ -919,19 +919,19 @@ | ||
| 919 | 919 | |
| 920 | 920 | /* If the "isexe" column is missing from the vfile table, then |
| 921 | 921 | ** add it now. This code added on 2010-03-06. After all users have |
| 922 | 922 | ** upgraded, this code can be safely deleted. |
| 923 | 923 | */ |
| 924 | - if( !strglob("* isexe *", zVFileDef) ){ | |
| 924 | + if( sqlite3_strglob("* isexe *", zVFileDef)!=0 ){ | |
| 925 | 925 | db_multi_exec("ALTER TABLE vfile ADD COLUMN isexe BOOLEAN DEFAULT 0"); |
| 926 | 926 | } |
| 927 | 927 | |
| 928 | 928 | /* If "islink"/"isLink" columns are missing from tables, then |
| 929 | 929 | ** add them now. This code added on 2011-01-17 and 2011-08-27. |
| 930 | 930 | ** After all users have upgraded, this code can be safely deleted. |
| 931 | 931 | */ |
| 932 | - if( !strglob("* islink *", zVFileDef) ){ | |
| 932 | + if( sqlite3_strglob("* islink *", zVFileDef)!=0 ){ | |
| 933 | 933 | db_multi_exec("ALTER TABLE vfile ADD COLUMN islink BOOLEAN DEFAULT 0"); |
| 934 | 934 | if( db_local_table_exists_but_lacks_column("stashfile", "isLink") ){ |
| 935 | 935 | db_multi_exec("ALTER TABLE stashfile ADD COLUMN isLink BOOL DEFAULT 0"); |
| 936 | 936 | } |
| 937 | 937 | if( db_local_table_exists_but_lacks_column("undo", "isLink") ){ |
| 938 | 938 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -892,11 +892,11 @@ | |
| 892 | " WHERE name=='%s' /*scan*/", |
| 893 | db_name("localdb"), zTable); |
| 894 | int rc = 0; |
| 895 | if( zDef ){ |
| 896 | char *zPattern = mprintf("* %s *", zColumn); |
| 897 | rc = strglob(zPattern, zDef)==0; |
| 898 | fossil_free(zPattern); |
| 899 | fossil_free(zDef); |
| 900 | } |
| 901 | return rc; |
| 902 | } |
| @@ -919,19 +919,19 @@ | |
| 919 | |
| 920 | /* If the "isexe" column is missing from the vfile table, then |
| 921 | ** add it now. This code added on 2010-03-06. After all users have |
| 922 | ** upgraded, this code can be safely deleted. |
| 923 | */ |
| 924 | if( !strglob("* isexe *", zVFileDef) ){ |
| 925 | db_multi_exec("ALTER TABLE vfile ADD COLUMN isexe BOOLEAN DEFAULT 0"); |
| 926 | } |
| 927 | |
| 928 | /* If "islink"/"isLink" columns are missing from tables, then |
| 929 | ** add them now. This code added on 2011-01-17 and 2011-08-27. |
| 930 | ** After all users have upgraded, this code can be safely deleted. |
| 931 | */ |
| 932 | if( !strglob("* islink *", zVFileDef) ){ |
| 933 | db_multi_exec("ALTER TABLE vfile ADD COLUMN islink BOOLEAN DEFAULT 0"); |
| 934 | if( db_local_table_exists_but_lacks_column("stashfile", "isLink") ){ |
| 935 | db_multi_exec("ALTER TABLE stashfile ADD COLUMN isLink BOOL DEFAULT 0"); |
| 936 | } |
| 937 | if( db_local_table_exists_but_lacks_column("undo", "isLink") ){ |
| 938 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -892,11 +892,11 @@ | |
| 892 | " WHERE name=='%s' /*scan*/", |
| 893 | db_name("localdb"), zTable); |
| 894 | int rc = 0; |
| 895 | if( zDef ){ |
| 896 | char *zPattern = mprintf("* %s *", zColumn); |
| 897 | rc = sqlite3_strglob(zPattern, zDef)!=0; |
| 898 | fossil_free(zPattern); |
| 899 | fossil_free(zDef); |
| 900 | } |
| 901 | return rc; |
| 902 | } |
| @@ -919,19 +919,19 @@ | |
| 919 | |
| 920 | /* If the "isexe" column is missing from the vfile table, then |
| 921 | ** add it now. This code added on 2010-03-06. After all users have |
| 922 | ** upgraded, this code can be safely deleted. |
| 923 | */ |
| 924 | if( sqlite3_strglob("* isexe *", zVFileDef)!=0 ){ |
| 925 | db_multi_exec("ALTER TABLE vfile ADD COLUMN isexe BOOLEAN DEFAULT 0"); |
| 926 | } |
| 927 | |
| 928 | /* If "islink"/"isLink" columns are missing from tables, then |
| 929 | ** add them now. This code added on 2011-01-17 and 2011-08-27. |
| 930 | ** After all users have upgraded, this code can be safely deleted. |
| 931 | */ |
| 932 | if( sqlite3_strglob("* islink *", zVFileDef)!=0 ){ |
| 933 | db_multi_exec("ALTER TABLE vfile ADD COLUMN islink BOOLEAN DEFAULT 0"); |
| 934 | if( db_local_table_exists_but_lacks_column("stashfile", "isLink") ){ |
| 935 | db_multi_exec("ALTER TABLE stashfile ADD COLUMN isLink BOOL DEFAULT 0"); |
| 936 | } |
| 937 | if( db_local_table_exists_but_lacks_column("undo", "isLink") ){ |
| 938 |
+5
-5
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -395,15 +395,15 @@ | ||
| 395 | 395 | /* If a URI appears in the User-Agent, it is probably a bot */ |
| 396 | 396 | if( strncmp("http", zAgent+i,4)==0 ) return 0; |
| 397 | 397 | } |
| 398 | 398 | if( strncmp(zAgent, "Mozilla/", 8)==0 ){ |
| 399 | 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; | |
| 400 | + if( sqlite3_strglob("*Firefox/[1-9]*", zAgent)==0 ) return 1; | |
| 401 | + if( sqlite3_strglob("*Chrome/[1-9]*", zAgent)==0 ) return 1; | |
| 402 | + if( sqlite3_strglob("*(compatible;?MSIE?[1789]*", zAgent)==0 ) return 1; | |
| 403 | + if( sqlite3_strglob("*Trident/[1-9]*;?rv:[1-9]*", zAgent)==0 ) return 1; /* IE11+ */ | |
| 404 | + if( sqlite3_strglob("*AppleWebKit/[1-9]*(KHTML*", zAgent)==0 ) return 1; | |
| 405 | 405 | return 0; |
| 406 | 406 | } |
| 407 | 407 | if( strncmp(zAgent, "Opera/", 6)==0 ) return 1; |
| 408 | 408 | if( strncmp(zAgent, "Safari/", 7)==0 ) return 1; |
| 409 | 409 | if( strncmp(zAgent, "Lynx/", 5)==0 ) return 1; |
| 410 | 410 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -395,15 +395,15 @@ | |
| 395 | /* If a URI appears in the User-Agent, it is probably a bot */ |
| 396 | if( strncmp("http", zAgent+i,4)==0 ) return 0; |
| 397 | } |
| 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 | if( strncmp(zAgent, "Lynx/", 5)==0 ) return 1; |
| 410 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -395,15 +395,15 @@ | |
| 395 | /* If a URI appears in the User-Agent, it is probably a bot */ |
| 396 | if( strncmp("http", zAgent+i,4)==0 ) return 0; |
| 397 | } |
| 398 | if( strncmp(zAgent, "Mozilla/", 8)==0 ){ |
| 399 | if( atoi(&zAgent[8])<4 ) return 0; /* Many bots advertise as Mozilla/3 */ |
| 400 | if( sqlite3_strglob("*Firefox/[1-9]*", zAgent)==0 ) return 1; |
| 401 | if( sqlite3_strglob("*Chrome/[1-9]*", zAgent)==0 ) return 1; |
| 402 | if( sqlite3_strglob("*(compatible;?MSIE?[1789]*", zAgent)==0 ) return 1; |
| 403 | if( sqlite3_strglob("*Trident/[1-9]*;?rv:[1-9]*", zAgent)==0 ) return 1; /* IE11+ */ |
| 404 | if( sqlite3_strglob("*AppleWebKit/[1-9]*(KHTML*", zAgent)==0 ) 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 | if( strncmp(zAgent, "Lynx/", 5)==0 ) return 1; |
| 410 |
+1
-1
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -175,11 +175,11 @@ | ||
| 175 | 175 | } |
| 176 | 176 | for(i=0; i<nFormAction; i++){ |
| 177 | 177 | @ gebi("form%d(i+1)").action="%s(aFormAction[i])"; |
| 178 | 178 | } |
| 179 | 179 | @ } |
| 180 | - if( strglob("*Opera Mini/[1-9]*", P("HTTP_USER_AGENT")) ){ | |
| 180 | + if( sqlite3_strglob("*Opera Mini/[1-9]*", P("HTTP_USER_AGENT"))==0 ){ | |
| 181 | 181 | /* Special case for Opera Mini, which executes JS server-side */ |
| 182 | 182 | @ var isOperaMini = Object.prototype.toString.call(window.operamini) |
| 183 | 183 | @ === "[object OperaMini]"; |
| 184 | 184 | @ if( isOperaMini ){ |
| 185 | 185 | @ setTimeout("setAllHrefs();",%d(nDelay)); |
| 186 | 186 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -175,11 +175,11 @@ | |
| 175 | } |
| 176 | for(i=0; i<nFormAction; i++){ |
| 177 | @ gebi("form%d(i+1)").action="%s(aFormAction[i])"; |
| 178 | } |
| 179 | @ } |
| 180 | if( strglob("*Opera Mini/[1-9]*", P("HTTP_USER_AGENT")) ){ |
| 181 | /* Special case for Opera Mini, which executes JS server-side */ |
| 182 | @ var isOperaMini = Object.prototype.toString.call(window.operamini) |
| 183 | @ === "[object OperaMini]"; |
| 184 | @ if( isOperaMini ){ |
| 185 | @ setTimeout("setAllHrefs();",%d(nDelay)); |
| 186 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -175,11 +175,11 @@ | |
| 175 | } |
| 176 | for(i=0; i<nFormAction; i++){ |
| 177 | @ gebi("form%d(i+1)").action="%s(aFormAction[i])"; |
| 178 | } |
| 179 | @ } |
| 180 | if( sqlite3_strglob("*Opera Mini/[1-9]*", P("HTTP_USER_AGENT"))==0 ){ |
| 181 | /* Special case for Opera Mini, which executes JS server-side */ |
| 182 | @ var isOperaMini = Object.prototype.toString.call(window.operamini) |
| 183 | @ === "[object OperaMini]"; |
| 184 | @ if( isOperaMini ){ |
| 185 | @ setTimeout("setAllHrefs();",%d(nDelay)); |
| 186 |
+2
-2
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -397,13 +397,13 @@ | ||
| 397 | 397 | "original", |
| 398 | 398 | "output", |
| 399 | 399 | }; |
| 400 | 400 | int i, j, n; |
| 401 | 401 | |
| 402 | - if( strglob("ci-comment-????????????.txt", zName) ) return 1; | |
| 402 | + if( sqlite3_strglob("ci-comment-????????????.txt", zName)==0 ) return 1; | |
| 403 | 403 | for(; zName[0]!=0; zName++){ |
| 404 | - if( zName[0]=='/' && strglob("/ci-comment-????????????.txt", zName) ){ | |
| 404 | + if( zName[0]=='/' && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ | |
| 405 | 405 | return 1; |
| 406 | 406 | } |
| 407 | 407 | if( zName[0]!='-' ) continue; |
| 408 | 408 | for(i=0; i<sizeof(azTemp)/sizeof(azTemp[0]); i++){ |
| 409 | 409 | n = (int)strlen(azTemp[i]); |
| 410 | 410 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -397,13 +397,13 @@ | |
| 397 | "original", |
| 398 | "output", |
| 399 | }; |
| 400 | int i, j, n; |
| 401 | |
| 402 | if( strglob("ci-comment-????????????.txt", zName) ) return 1; |
| 403 | for(; zName[0]!=0; zName++){ |
| 404 | if( zName[0]=='/' && strglob("/ci-comment-????????????.txt", zName) ){ |
| 405 | return 1; |
| 406 | } |
| 407 | if( zName[0]!='-' ) continue; |
| 408 | for(i=0; i<sizeof(azTemp)/sizeof(azTemp[0]); i++){ |
| 409 | n = (int)strlen(azTemp[i]); |
| 410 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -397,13 +397,13 @@ | |
| 397 | "original", |
| 398 | "output", |
| 399 | }; |
| 400 | int i, j, n; |
| 401 | |
| 402 | if( sqlite3_strglob("ci-comment-????????????.txt", zName)==0 ) return 1; |
| 403 | for(; zName[0]!=0; zName++){ |
| 404 | if( zName[0]=='/' && sqlite3_strglob("/ci-comment-????????????.txt", zName)==0 ){ |
| 405 | return 1; |
| 406 | } |
| 407 | if( zName[0]!='-' ) continue; |
| 408 | for(i=0; i<sizeof(azTemp)/sizeof(azTemp[0]); i++){ |
| 409 | n = (int)strlen(azTemp[i]); |
| 410 |
+1
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1814,11 +1814,11 @@ | ||
| 1814 | 1814 | ** to the next cycle. |
| 1815 | 1815 | */ |
| 1816 | 1816 | if( blob_eq(&xfer.aToken[0],"message") && xfer.nToken==2 ){ |
| 1817 | 1817 | char *zMsg = blob_terminate(&xfer.aToken[1]); |
| 1818 | 1818 | defossilize(zMsg); |
| 1819 | - if( (syncFlags & SYNC_PUSH) && zMsg && strglob("pull only *", zMsg) ){ | |
| 1819 | + if( (syncFlags & SYNC_PUSH) && zMsg && sqlite3_strglob("pull only *", zMsg)==0 ){ | |
| 1820 | 1820 | syncFlags &= ~SYNC_PUSH; |
| 1821 | 1821 | zMsg = 0; |
| 1822 | 1822 | } |
| 1823 | 1823 | if( zMsg && zMsg[0] ){ |
| 1824 | 1824 | fossil_force_newline(); |
| 1825 | 1825 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1814,11 +1814,11 @@ | |
| 1814 | ** to the next cycle. |
| 1815 | */ |
| 1816 | if( blob_eq(&xfer.aToken[0],"message") && xfer.nToken==2 ){ |
| 1817 | char *zMsg = blob_terminate(&xfer.aToken[1]); |
| 1818 | defossilize(zMsg); |
| 1819 | if( (syncFlags & SYNC_PUSH) && zMsg && strglob("pull only *", zMsg) ){ |
| 1820 | syncFlags &= ~SYNC_PUSH; |
| 1821 | zMsg = 0; |
| 1822 | } |
| 1823 | if( zMsg && zMsg[0] ){ |
| 1824 | fossil_force_newline(); |
| 1825 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1814,11 +1814,11 @@ | |
| 1814 | ** to the next cycle. |
| 1815 | */ |
| 1816 | if( blob_eq(&xfer.aToken[0],"message") && xfer.nToken==2 ){ |
| 1817 | char *zMsg = blob_terminate(&xfer.aToken[1]); |
| 1818 | defossilize(zMsg); |
| 1819 | if( (syncFlags & SYNC_PUSH) && zMsg && sqlite3_strglob("pull only *", zMsg)==0 ){ |
| 1820 | syncFlags &= ~SYNC_PUSH; |
| 1821 | zMsg = 0; |
| 1822 | } |
| 1823 | if( zMsg && zMsg[0] ){ |
| 1824 | fossil_force_newline(); |
| 1825 |