Fossil SCM

strglob() -> sqlite3_strglob()

jan.nijtmans 2014-10-14 13:10 trunk
Commit 2271ea42fe35fee4afbc1980c5811c8d2c71c531
+1 -1
--- src/browse.c
+++ src/browse.c
@@ -759,11 +759,11 @@
759759
db_prepare(&ins,
760760
"INSERT INTO temp.fileage(fid, pathname)"
761761
" SELECT rid, :path FROM blob WHERE uuid=:uuid"
762762
);
763763
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;
765765
db_bind_text(&ins, ":uuid", pFile->zUuid);
766766
db_bind_text(&ins, ":path", pFile->zName);
767767
db_step(&ins);
768768
db_reset(&ins);
769769
nFile++;
770770
--- 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 @@
277277
** Return true if the response should be sent with Content-Encoding: gzip.
278278
*/
279279
static int is_gzippable(void){
280280
if( strstr(PD("HTTP_ACCEPT_ENCODING", ""), "gzip")==0 ) return 0;
281281
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;
284284
}
285285
286286
/*
287287
** Do a normal HTTP reply
288288
*/
289289
--- 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
+3 -3
--- src/db.c
+++ src/db.c
@@ -892,11 +892,11 @@
892892
" WHERE name=='%s' /*scan*/",
893893
db_name("localdb"), zTable);
894894
int rc = 0;
895895
if( zDef ){
896896
char *zPattern = mprintf("* %s *", zColumn);
897
- rc = strglob(zPattern, zDef)==0;
897
+ rc = sqlite3_strglob(zPattern, zDef)!=0;
898898
fossil_free(zPattern);
899899
fossil_free(zDef);
900900
}
901901
return rc;
902902
}
@@ -919,19 +919,19 @@
919919
920920
/* If the "isexe" column is missing from the vfile table, then
921921
** add it now. This code added on 2010-03-06. After all users have
922922
** upgraded, this code can be safely deleted.
923923
*/
924
- if( !strglob("* isexe *", zVFileDef) ){
924
+ if( sqlite3_strglob("* isexe *", zVFileDef)!=0 ){
925925
db_multi_exec("ALTER TABLE vfile ADD COLUMN isexe BOOLEAN DEFAULT 0");
926926
}
927927
928928
/* If "islink"/"isLink" columns are missing from tables, then
929929
** add them now. This code added on 2011-01-17 and 2011-08-27.
930930
** After all users have upgraded, this code can be safely deleted.
931931
*/
932
- if( !strglob("* islink *", zVFileDef) ){
932
+ if( sqlite3_strglob("* islink *", zVFileDef)!=0 ){
933933
db_multi_exec("ALTER TABLE vfile ADD COLUMN islink BOOLEAN DEFAULT 0");
934934
if( db_local_table_exists_but_lacks_column("stashfile", "isLink") ){
935935
db_multi_exec("ALTER TABLE stashfile ADD COLUMN isLink BOOL DEFAULT 0");
936936
}
937937
if( db_local_table_exists_but_lacks_column("undo", "isLink") ){
938938
--- 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 @@
395395
/* If a URI appears in the User-Agent, it is probably a bot */
396396
if( strncmp("http", zAgent+i,4)==0 ) return 0;
397397
}
398398
if( strncmp(zAgent, "Mozilla/", 8)==0 ){
399399
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;
405405
return 0;
406406
}
407407
if( strncmp(zAgent, "Opera/", 6)==0 ) return 1;
408408
if( strncmp(zAgent, "Safari/", 7)==0 ) return 1;
409409
if( strncmp(zAgent, "Lynx/", 5)==0 ) return 1;
410410
--- 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 @@
175175
}
176176
for(i=0; i<nFormAction; i++){
177177
@ gebi("form%d(i+1)").action="%s(aFormAction[i])";
178178
}
179179
@ }
180
- if( strglob("*Opera Mini/[1-9]*", P("HTTP_USER_AGENT")) ){
180
+ if( sqlite3_strglob("*Opera Mini/[1-9]*", P("HTTP_USER_AGENT"))==0 ){
181181
/* Special case for Opera Mini, which executes JS server-side */
182182
@ var isOperaMini = Object.prototype.toString.call(window.operamini)
183183
@ === "[object OperaMini]";
184184
@ if( isOperaMini ){
185185
@ setTimeout("setAllHrefs();",%d(nDelay));
186186
--- 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 @@
397397
"original",
398398
"output",
399399
};
400400
int i, j, n;
401401
402
- if( strglob("ci-comment-????????????.txt", zName) ) return 1;
402
+ if( sqlite3_strglob("ci-comment-????????????.txt", zName)==0 ) return 1;
403403
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 ){
405405
return 1;
406406
}
407407
if( zName[0]!='-' ) continue;
408408
for(i=0; i<sizeof(azTemp)/sizeof(azTemp[0]); i++){
409409
n = (int)strlen(azTemp[i]);
410410
--- 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 @@
18141814
** to the next cycle.
18151815
*/
18161816
if( blob_eq(&xfer.aToken[0],"message") && xfer.nToken==2 ){
18171817
char *zMsg = blob_terminate(&xfer.aToken[1]);
18181818
defossilize(zMsg);
1819
- if( (syncFlags & SYNC_PUSH) && zMsg && strglob("pull only *", zMsg) ){
1819
+ if( (syncFlags & SYNC_PUSH) && zMsg && sqlite3_strglob("pull only *", zMsg)==0 ){
18201820
syncFlags &= ~SYNC_PUSH;
18211821
zMsg = 0;
18221822
}
18231823
if( zMsg && zMsg[0] ){
18241824
fossil_force_newline();
18251825
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button