Fossil SCM

Compiler warning and coding style fixes.

mistachkin 2016-05-27 21:03 trunk
Commit d0374689105abd9750a97a557f40e250a37bbfd9
+1 -1
--- src/attach.c
+++ src/attach.c
@@ -712,11 +712,11 @@
712712
if( n==0 ){
713713
goto attachment_cmd_usage;
714714
}
715715
716716
if( strncmp(g.argv[2],"add",n)==0 ){
717
- const char *zPageName; /* Name of the wiki page to attach to */
717
+ const char *zPageName = 0; /* Name of the wiki page to attach to */
718718
const char *zFile; /* Name of the file to be attached */
719719
const char *zETime; /* The name of the technote to attach to */
720720
Manifest *pWiki = 0; /* Parsed wiki page content */
721721
char *zBody = 0; /* Wiki page content */
722722
int rid;
723723
--- src/attach.c
+++ src/attach.c
@@ -712,11 +712,11 @@
712 if( n==0 ){
713 goto attachment_cmd_usage;
714 }
715
716 if( strncmp(g.argv[2],"add",n)==0 ){
717 const char *zPageName; /* Name of the wiki page to attach to */
718 const char *zFile; /* Name of the file to be attached */
719 const char *zETime; /* The name of the technote to attach to */
720 Manifest *pWiki = 0; /* Parsed wiki page content */
721 char *zBody = 0; /* Wiki page content */
722 int rid;
723
--- src/attach.c
+++ src/attach.c
@@ -712,11 +712,11 @@
712 if( n==0 ){
713 goto attachment_cmd_usage;
714 }
715
716 if( strncmp(g.argv[2],"add",n)==0 ){
717 const char *zPageName = 0; /* Name of the wiki page to attach to */
718 const char *zFile; /* Name of the file to be attached */
719 const char *zETime; /* The name of the technote to attach to */
720 Manifest *pWiki = 0; /* Parsed wiki page content */
721 char *zBody = 0; /* Wiki page content */
722 int rid;
723
+12 -11
--- src/import.c
+++ src/import.c
@@ -1536,16 +1536,16 @@
15361536
15371537
/* Options common to all input formats */
15381538
int incrFlag = find_option("incremental", "i", 0)!=0;
15391539
15401540
/* Options for --svn only */
1541
- const char *zBase="";
1542
- int flatFlag=0;
1541
+ const char *zBase = "";
1542
+ int flatFlag = 0;
15431543
15441544
/* Options for --git only */
1545
- const char *markfile_in;
1546
- const char *markfile_out;
1545
+ const char *markfile_in = 0;
1546
+ const char *markfile_out = 0;
15471547
15481548
if( svnFlag ){
15491549
/* Get --svn related options here, so verify_all_options() fail when svn
15501550
* only option are specify with --git
15511551
*/
@@ -1661,13 +1661,13 @@
16611661
"CREATE TEMP TABLE xmark(tname TEXT UNIQUE, trid INT, tuuid TEXT);"
16621662
"CREATE TEMP TABLE xbranch(tname TEXT UNIQUE, brnm TEXT);"
16631663
"CREATE TEMP TABLE xtag(tname TEXT UNIQUE, tcontent TEXT);"
16641664
);
16651665
1666
- if(markfile_in){
1666
+ if( markfile_in ){
16671667
FILE *f = fossil_fopen(markfile_in, "r");
1668
- if(!f){
1668
+ if( !f ){
16691669
fossil_fatal("cannot open %s for reading\n", markfile_in);
16701670
}
16711671
if(import_marks(f, &blobs, NULL)<0){
16721672
fossil_fatal("error importing marks from file: %s\n", markfile_in);
16731673
}
@@ -1682,28 +1682,29 @@
16821682
db_ephemeral_blob(&q, 0, &record);
16831683
fast_insert_content(&record, 0, 0, 1);
16841684
import_reset(0);
16851685
}
16861686
db_finalize(&q);
1687
- if(markfile_out){
1687
+ if( markfile_out ){
16881688
int rid;
16891689
Stmt q_marks;
16901690
FILE *f;
16911691
db_prepare(&q_marks, "SELECT DISTINCT trid FROM xmark");
1692
- while( db_step(&q_marks)==SQLITE_ROW){
1692
+ while( db_step(&q_marks)==SQLITE_ROW ){
16931693
rid = db_column_int(&q_marks, 0);
1694
- if(db_int(0, "SELECT count(objid) FROM event WHERE objid=%d AND type='ci'", rid)==0){
1695
- if(bag_find(&blobs, rid)==0){
1694
+ if( db_int(0, "SELECT count(objid) FROM event"
1695
+ " WHERE objid=%d AND type='ci'", rid)==0 ){
1696
+ if( bag_find(&blobs, rid)==0 ){
16961697
bag_insert(&blobs, rid);
16971698
}
16981699
}else{
16991700
bag_insert(&vers, rid);
17001701
}
17011702
}
17021703
db_finalize(&q_marks);
17031704
f = fossil_fopen(markfile_out, "w");
1704
- if(!f){
1705
+ if( !f ){
17051706
fossil_fatal("cannot open %s for writing\n", markfile_out);
17061707
}
17071708
export_marks(f, &blobs, &vers);
17081709
fclose(f);
17091710
bag_clear(&blobs);
17101711
--- src/import.c
+++ src/import.c
@@ -1536,16 +1536,16 @@
1536
1537 /* Options common to all input formats */
1538 int incrFlag = find_option("incremental", "i", 0)!=0;
1539
1540 /* Options for --svn only */
1541 const char *zBase="";
1542 int flatFlag=0;
1543
1544 /* Options for --git only */
1545 const char *markfile_in;
1546 const char *markfile_out;
1547
1548 if( svnFlag ){
1549 /* Get --svn related options here, so verify_all_options() fail when svn
1550 * only option are specify with --git
1551 */
@@ -1661,13 +1661,13 @@
1661 "CREATE TEMP TABLE xmark(tname TEXT UNIQUE, trid INT, tuuid TEXT);"
1662 "CREATE TEMP TABLE xbranch(tname TEXT UNIQUE, brnm TEXT);"
1663 "CREATE TEMP TABLE xtag(tname TEXT UNIQUE, tcontent TEXT);"
1664 );
1665
1666 if(markfile_in){
1667 FILE *f = fossil_fopen(markfile_in, "r");
1668 if(!f){
1669 fossil_fatal("cannot open %s for reading\n", markfile_in);
1670 }
1671 if(import_marks(f, &blobs, NULL)<0){
1672 fossil_fatal("error importing marks from file: %s\n", markfile_in);
1673 }
@@ -1682,28 +1682,29 @@
1682 db_ephemeral_blob(&q, 0, &record);
1683 fast_insert_content(&record, 0, 0, 1);
1684 import_reset(0);
1685 }
1686 db_finalize(&q);
1687 if(markfile_out){
1688 int rid;
1689 Stmt q_marks;
1690 FILE *f;
1691 db_prepare(&q_marks, "SELECT DISTINCT trid FROM xmark");
1692 while( db_step(&q_marks)==SQLITE_ROW){
1693 rid = db_column_int(&q_marks, 0);
1694 if(db_int(0, "SELECT count(objid) FROM event WHERE objid=%d AND type='ci'", rid)==0){
1695 if(bag_find(&blobs, rid)==0){
 
1696 bag_insert(&blobs, rid);
1697 }
1698 }else{
1699 bag_insert(&vers, rid);
1700 }
1701 }
1702 db_finalize(&q_marks);
1703 f = fossil_fopen(markfile_out, "w");
1704 if(!f){
1705 fossil_fatal("cannot open %s for writing\n", markfile_out);
1706 }
1707 export_marks(f, &blobs, &vers);
1708 fclose(f);
1709 bag_clear(&blobs);
1710
--- src/import.c
+++ src/import.c
@@ -1536,16 +1536,16 @@
1536
1537 /* Options common to all input formats */
1538 int incrFlag = find_option("incremental", "i", 0)!=0;
1539
1540 /* Options for --svn only */
1541 const char *zBase = "";
1542 int flatFlag = 0;
1543
1544 /* Options for --git only */
1545 const char *markfile_in = 0;
1546 const char *markfile_out = 0;
1547
1548 if( svnFlag ){
1549 /* Get --svn related options here, so verify_all_options() fail when svn
1550 * only option are specify with --git
1551 */
@@ -1661,13 +1661,13 @@
1661 "CREATE TEMP TABLE xmark(tname TEXT UNIQUE, trid INT, tuuid TEXT);"
1662 "CREATE TEMP TABLE xbranch(tname TEXT UNIQUE, brnm TEXT);"
1663 "CREATE TEMP TABLE xtag(tname TEXT UNIQUE, tcontent TEXT);"
1664 );
1665
1666 if( markfile_in ){
1667 FILE *f = fossil_fopen(markfile_in, "r");
1668 if( !f ){
1669 fossil_fatal("cannot open %s for reading\n", markfile_in);
1670 }
1671 if(import_marks(f, &blobs, NULL)<0){
1672 fossil_fatal("error importing marks from file: %s\n", markfile_in);
1673 }
@@ -1682,28 +1682,29 @@
1682 db_ephemeral_blob(&q, 0, &record);
1683 fast_insert_content(&record, 0, 0, 1);
1684 import_reset(0);
1685 }
1686 db_finalize(&q);
1687 if( markfile_out ){
1688 int rid;
1689 Stmt q_marks;
1690 FILE *f;
1691 db_prepare(&q_marks, "SELECT DISTINCT trid FROM xmark");
1692 while( db_step(&q_marks)==SQLITE_ROW ){
1693 rid = db_column_int(&q_marks, 0);
1694 if( db_int(0, "SELECT count(objid) FROM event"
1695 " WHERE objid=%d AND type='ci'", rid)==0 ){
1696 if( bag_find(&blobs, rid)==0 ){
1697 bag_insert(&blobs, rid);
1698 }
1699 }else{
1700 bag_insert(&vers, rid);
1701 }
1702 }
1703 db_finalize(&q_marks);
1704 f = fossil_fopen(markfile_out, "w");
1705 if( !f ){
1706 fossil_fatal("cannot open %s for writing\n", markfile_out);
1707 }
1708 export_marks(f, &blobs, &vers);
1709 fclose(f);
1710 bag_clear(&blobs);
1711
+1 -1
--- src/merge.c
+++ src/merge.c
@@ -213,11 +213,11 @@
213213
** -v|--verbose Show additional details of the merge
214214
*/
215215
void merge_cmd(void){
216216
int vid; /* Current version "V" */
217217
int mid; /* Version we are merging from "M" */
218
- int pid; /* The pivot version - most recent common ancestor P */
218
+ int pid = 0; /* The pivot version - most recent common ancestor P */
219219
int nid = 0; /* The name pivot version "N" */
220220
int verboseFlag; /* True if the -v|--verbose option is present */
221221
int integrateFlag; /* True if the --integrate option is present */
222222
int pickFlag; /* True if the --cherrypick option is present */
223223
int backoutFlag; /* True if the --backout option is present */
224224
--- src/merge.c
+++ src/merge.c
@@ -213,11 +213,11 @@
213 ** -v|--verbose Show additional details of the merge
214 */
215 void merge_cmd(void){
216 int vid; /* Current version "V" */
217 int mid; /* Version we are merging from "M" */
218 int pid; /* The pivot version - most recent common ancestor P */
219 int nid = 0; /* The name pivot version "N" */
220 int verboseFlag; /* True if the -v|--verbose option is present */
221 int integrateFlag; /* True if the --integrate option is present */
222 int pickFlag; /* True if the --cherrypick option is present */
223 int backoutFlag; /* True if the --backout option is present */
224
--- src/merge.c
+++ src/merge.c
@@ -213,11 +213,11 @@
213 ** -v|--verbose Show additional details of the merge
214 */
215 void merge_cmd(void){
216 int vid; /* Current version "V" */
217 int mid; /* Version we are merging from "M" */
218 int pid = 0; /* The pivot version - most recent common ancestor P */
219 int nid = 0; /* The name pivot version "N" */
220 int verboseFlag; /* True if the -v|--verbose option is present */
221 int integrateFlag; /* True if the --integrate option is present */
222 int pickFlag; /* True if the --cherrypick option is present */
223 int backoutFlag; /* True if the --backout option is present */
224
+1 -1
--- src/report.c
+++ src/report.c
@@ -1183,11 +1183,11 @@
11831183
}
11841184
}
11851185
11861186
count = 0;
11871187
if( !tabs ){
1188
- struct GenerateHTML sState;
1188
+ struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
11891189
11901190
db_multi_exec("PRAGMA empty_result_callbacks=ON");
11911191
style_submenu_element("Raw", "Raw",
11921192
"rptview?tablist=1&%h", PD("QUERY_STRING",""));
11931193
if( g.perm.Admin
11941194
--- src/report.c
+++ src/report.c
@@ -1183,11 +1183,11 @@
1183 }
1184 }
1185
1186 count = 0;
1187 if( !tabs ){
1188 struct GenerateHTML sState;
1189
1190 db_multi_exec("PRAGMA empty_result_callbacks=ON");
1191 style_submenu_element("Raw", "Raw",
1192 "rptview?tablist=1&%h", PD("QUERY_STRING",""));
1193 if( g.perm.Admin
1194
--- src/report.c
+++ src/report.c
@@ -1183,11 +1183,11 @@
1183 }
1184 }
1185
1186 count = 0;
1187 if( !tabs ){
1188 struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
1189
1190 db_multi_exec("PRAGMA empty_result_callbacks=ON");
1191 style_submenu_element("Raw", "Raw",
1192 "rptview?tablist=1&%h", PD("QUERY_STRING",""));
1193 if( g.perm.Admin
1194
+2 -2
--- src/search.c
+++ src/search.c
@@ -453,11 +453,11 @@
453453
sqlite3_value **argv
454454
){
455455
const char *zType = (const char*)sqlite3_value_text(argv[0]);
456456
int rid = sqlite3_value_int(argv[1]);
457457
const char *zName = (const char*)sqlite3_value_text(argv[2]);
458
- int nHdr;
458
+ int nHdr = 0;
459459
char *z = search_stext_cached(zType[0], rid, zName, &nHdr);
460460
if( nHdr || zType[0]!='d' ){
461461
sqlite3_result_text(context, z, nHdr, SQLITE_TRANSIENT);
462462
}else{
463463
sqlite3_result_value(context, argv[2]);
@@ -469,11 +469,11 @@
469469
sqlite3_value **argv
470470
){
471471
const char *zType = (const char*)sqlite3_value_text(argv[0]);
472472
int rid = sqlite3_value_int(argv[1]);
473473
const char *zName = (const char*)sqlite3_value_text(argv[2]);
474
- int nHdr;
474
+ int nHdr = 0;
475475
char *z = search_stext_cached(zType[0], rid, zName, &nHdr);
476476
sqlite3_result_text(context, z+nHdr+1, -1, SQLITE_TRANSIENT);
477477
}
478478
479479
/*
480480
--- src/search.c
+++ src/search.c
@@ -453,11 +453,11 @@
453 sqlite3_value **argv
454 ){
455 const char *zType = (const char*)sqlite3_value_text(argv[0]);
456 int rid = sqlite3_value_int(argv[1]);
457 const char *zName = (const char*)sqlite3_value_text(argv[2]);
458 int nHdr;
459 char *z = search_stext_cached(zType[0], rid, zName, &nHdr);
460 if( nHdr || zType[0]!='d' ){
461 sqlite3_result_text(context, z, nHdr, SQLITE_TRANSIENT);
462 }else{
463 sqlite3_result_value(context, argv[2]);
@@ -469,11 +469,11 @@
469 sqlite3_value **argv
470 ){
471 const char *zType = (const char*)sqlite3_value_text(argv[0]);
472 int rid = sqlite3_value_int(argv[1]);
473 const char *zName = (const char*)sqlite3_value_text(argv[2]);
474 int nHdr;
475 char *z = search_stext_cached(zType[0], rid, zName, &nHdr);
476 sqlite3_result_text(context, z+nHdr+1, -1, SQLITE_TRANSIENT);
477 }
478
479 /*
480
--- src/search.c
+++ src/search.c
@@ -453,11 +453,11 @@
453 sqlite3_value **argv
454 ){
455 const char *zType = (const char*)sqlite3_value_text(argv[0]);
456 int rid = sqlite3_value_int(argv[1]);
457 const char *zName = (const char*)sqlite3_value_text(argv[2]);
458 int nHdr = 0;
459 char *z = search_stext_cached(zType[0], rid, zName, &nHdr);
460 if( nHdr || zType[0]!='d' ){
461 sqlite3_result_text(context, z, nHdr, SQLITE_TRANSIENT);
462 }else{
463 sqlite3_result_value(context, argv[2]);
@@ -469,11 +469,11 @@
469 sqlite3_value **argv
470 ){
471 const char *zType = (const char*)sqlite3_value_text(argv[0]);
472 int rid = sqlite3_value_int(argv[1]);
473 const char *zName = (const char*)sqlite3_value_text(argv[2]);
474 int nHdr = 0;
475 char *z = search_stext_cached(zType[0], rid, zName, &nHdr);
476 sqlite3_result_text(context, z+nHdr+1, -1, SQLITE_TRANSIENT);
477 }
478
479 /*
480
+8 -8
--- src/wiki.c
+++ src/wiki.c
@@ -1266,11 +1266,11 @@
12661266
}else{
12671267
if( (g.argc!=3) && (g.argc!=4) ){
12681268
usage("export ?FILE? --technote DATETIME|TECHNOTE-ID");
12691269
}
12701270
rid = wiki_technote_to_rid(zETime);
1271
- if (rid == -1) {
1271
+ if ( rid==-1 ){
12721272
fossil_fatal("ambiguous tech note id: %s", zETime);
12731273
}
12741274
if( (pWiki = manifest_get(rid, CFTYPE_EVENT, 0))!=0 ){
12751275
zBody = pWiki->zWiki;
12761276
}
@@ -1289,11 +1289,11 @@
12891289
return;
12901290
}else if( strncmp(g.argv[2],"commit",n)==0
12911291
|| strncmp(g.argv[2],"create",n)==0 ){
12921292
const char *zPageName; /* page name */
12931293
Blob content; /* Input content */
1294
- int rid;
1294
+ int rid = 0;
12951295
Manifest *pWiki = 0; /* Parsed wiki page content */
12961296
const char *zMimeType = find_option("mimetype", "M", 1);
12971297
const char *zETime = find_option("technote", "t", 1);
12981298
const char *zTags = find_option("technote-tags", NULL, 1);
12991299
const char *zClr = find_option("technote-bgcolor", NULL, 1);
@@ -1306,26 +1306,26 @@
13061306
if( g.argc==4 ){
13071307
blob_read_from_channel(&content, stdin, -1);
13081308
}else{
13091309
blob_read_from_file(&content, g.argv[4]);
13101310
}
1311
- if(!zMimeType || !*zMimeType){
1311
+ if( !zMimeType || !*zMimeType ){
13121312
/* Try to deduce the mime type based on the prior version. */
13131313
if ( !zETime ){
13141314
rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x"
13151315
" WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'"
13161316
" ORDER BY x.mtime DESC LIMIT 1",
13171317
zPageName
13181318
);
1319
- if(rid>0 && (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0
1320
- && (pWiki->zMimetype && *pWiki->zMimetype)){
1319
+ if( rid>0 && (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0
1320
+ && (pWiki->zMimetype && *pWiki->zMimetype) ){
13211321
zMimeType = pWiki->zMimetype;
13221322
}
13231323
}else{
13241324
rid = wiki_technote_to_rid(zETime);
1325
- if(rid>0 && (pWiki = manifest_get(rid, CFTYPE_EVENT, 0))!=0
1326
- && (pWiki->zMimetype && *pWiki->zMimetype)){
1325
+ if( rid>0 && (pWiki = manifest_get(rid, CFTYPE_EVENT, 0))!=0
1326
+ && (pWiki->zMimetype && *pWiki->zMimetype) ){
13271327
zMimeType = pWiki->zMimetype;
13281328
}
13291329
}
13301330
}else{
13311331
zMimeType = wiki_filter_mimetypes(zMimeType);
@@ -1399,11 +1399,11 @@
13991399
);
14001400
}
14011401
14021402
while( db_step(&q)==SQLITE_ROW ){
14031403
const char *zName = db_column_text(&q, 0);
1404
- if (showIds) {
1404
+ if( showIds ){
14051405
const char *zUuid = db_column_text(&q, 1);
14061406
fossil_print("%s ",zUuid);
14071407
}
14081408
fossil_print( "%s\n",zName);
14091409
}
14101410
--- src/wiki.c
+++ src/wiki.c
@@ -1266,11 +1266,11 @@
1266 }else{
1267 if( (g.argc!=3) && (g.argc!=4) ){
1268 usage("export ?FILE? --technote DATETIME|TECHNOTE-ID");
1269 }
1270 rid = wiki_technote_to_rid(zETime);
1271 if (rid == -1) {
1272 fossil_fatal("ambiguous tech note id: %s", zETime);
1273 }
1274 if( (pWiki = manifest_get(rid, CFTYPE_EVENT, 0))!=0 ){
1275 zBody = pWiki->zWiki;
1276 }
@@ -1289,11 +1289,11 @@
1289 return;
1290 }else if( strncmp(g.argv[2],"commit",n)==0
1291 || strncmp(g.argv[2],"create",n)==0 ){
1292 const char *zPageName; /* page name */
1293 Blob content; /* Input content */
1294 int rid;
1295 Manifest *pWiki = 0; /* Parsed wiki page content */
1296 const char *zMimeType = find_option("mimetype", "M", 1);
1297 const char *zETime = find_option("technote", "t", 1);
1298 const char *zTags = find_option("technote-tags", NULL, 1);
1299 const char *zClr = find_option("technote-bgcolor", NULL, 1);
@@ -1306,26 +1306,26 @@
1306 if( g.argc==4 ){
1307 blob_read_from_channel(&content, stdin, -1);
1308 }else{
1309 blob_read_from_file(&content, g.argv[4]);
1310 }
1311 if(!zMimeType || !*zMimeType){
1312 /* Try to deduce the mime type based on the prior version. */
1313 if ( !zETime ){
1314 rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x"
1315 " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'"
1316 " ORDER BY x.mtime DESC LIMIT 1",
1317 zPageName
1318 );
1319 if(rid>0 && (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0
1320 && (pWiki->zMimetype && *pWiki->zMimetype)){
1321 zMimeType = pWiki->zMimetype;
1322 }
1323 }else{
1324 rid = wiki_technote_to_rid(zETime);
1325 if(rid>0 && (pWiki = manifest_get(rid, CFTYPE_EVENT, 0))!=0
1326 && (pWiki->zMimetype && *pWiki->zMimetype)){
1327 zMimeType = pWiki->zMimetype;
1328 }
1329 }
1330 }else{
1331 zMimeType = wiki_filter_mimetypes(zMimeType);
@@ -1399,11 +1399,11 @@
1399 );
1400 }
1401
1402 while( db_step(&q)==SQLITE_ROW ){
1403 const char *zName = db_column_text(&q, 0);
1404 if (showIds) {
1405 const char *zUuid = db_column_text(&q, 1);
1406 fossil_print("%s ",zUuid);
1407 }
1408 fossil_print( "%s\n",zName);
1409 }
1410
--- src/wiki.c
+++ src/wiki.c
@@ -1266,11 +1266,11 @@
1266 }else{
1267 if( (g.argc!=3) && (g.argc!=4) ){
1268 usage("export ?FILE? --technote DATETIME|TECHNOTE-ID");
1269 }
1270 rid = wiki_technote_to_rid(zETime);
1271 if ( rid==-1 ){
1272 fossil_fatal("ambiguous tech note id: %s", zETime);
1273 }
1274 if( (pWiki = manifest_get(rid, CFTYPE_EVENT, 0))!=0 ){
1275 zBody = pWiki->zWiki;
1276 }
@@ -1289,11 +1289,11 @@
1289 return;
1290 }else if( strncmp(g.argv[2],"commit",n)==0
1291 || strncmp(g.argv[2],"create",n)==0 ){
1292 const char *zPageName; /* page name */
1293 Blob content; /* Input content */
1294 int rid = 0;
1295 Manifest *pWiki = 0; /* Parsed wiki page content */
1296 const char *zMimeType = find_option("mimetype", "M", 1);
1297 const char *zETime = find_option("technote", "t", 1);
1298 const char *zTags = find_option("technote-tags", NULL, 1);
1299 const char *zClr = find_option("technote-bgcolor", NULL, 1);
@@ -1306,26 +1306,26 @@
1306 if( g.argc==4 ){
1307 blob_read_from_channel(&content, stdin, -1);
1308 }else{
1309 blob_read_from_file(&content, g.argv[4]);
1310 }
1311 if( !zMimeType || !*zMimeType ){
1312 /* Try to deduce the mime type based on the prior version. */
1313 if ( !zETime ){
1314 rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x"
1315 " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'"
1316 " ORDER BY x.mtime DESC LIMIT 1",
1317 zPageName
1318 );
1319 if( rid>0 && (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0
1320 && (pWiki->zMimetype && *pWiki->zMimetype) ){
1321 zMimeType = pWiki->zMimetype;
1322 }
1323 }else{
1324 rid = wiki_technote_to_rid(zETime);
1325 if( rid>0 && (pWiki = manifest_get(rid, CFTYPE_EVENT, 0))!=0
1326 && (pWiki->zMimetype && *pWiki->zMimetype) ){
1327 zMimeType = pWiki->zMimetype;
1328 }
1329 }
1330 }else{
1331 zMimeType = wiki_filter_mimetypes(zMimeType);
@@ -1399,11 +1399,11 @@
1399 );
1400 }
1401
1402 while( db_step(&q)==SQLITE_ROW ){
1403 const char *zName = db_column_text(&q, 0);
1404 if( showIds ){
1405 const char *zUuid = db_column_text(&q, 1);
1406 fossil_print("%s ",zUuid);
1407 }
1408 fossil_print( "%s\n",zName);
1409 }
1410

Keyboard Shortcuts

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