Fossil SCM
Compiler warning and coding style fixes.
Commit
d0374689105abd9750a97a557f40e250a37bbfd9
Parent
893905c83e3dd51…
6 files changed
+1
-1
+12
-11
+1
-1
+1
-1
+2
-2
+8
-8
+1
-1
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -712,11 +712,11 @@ | ||
| 712 | 712 | if( n==0 ){ |
| 713 | 713 | goto attachment_cmd_usage; |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | 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 */ | |
| 718 | 718 | const char *zFile; /* Name of the file to be attached */ |
| 719 | 719 | const char *zETime; /* The name of the technote to attach to */ |
| 720 | 720 | Manifest *pWiki = 0; /* Parsed wiki page content */ |
| 721 | 721 | char *zBody = 0; /* Wiki page content */ |
| 722 | 722 | int rid; |
| 723 | 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; /* 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 @@ | ||
| 1536 | 1536 | |
| 1537 | 1537 | /* Options common to all input formats */ |
| 1538 | 1538 | int incrFlag = find_option("incremental", "i", 0)!=0; |
| 1539 | 1539 | |
| 1540 | 1540 | /* Options for --svn only */ |
| 1541 | - const char *zBase=""; | |
| 1542 | - int flatFlag=0; | |
| 1541 | + const char *zBase = ""; | |
| 1542 | + int flatFlag = 0; | |
| 1543 | 1543 | |
| 1544 | 1544 | /* 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; | |
| 1547 | 1547 | |
| 1548 | 1548 | if( svnFlag ){ |
| 1549 | 1549 | /* Get --svn related options here, so verify_all_options() fail when svn |
| 1550 | 1550 | * only option are specify with --git |
| 1551 | 1551 | */ |
| @@ -1661,13 +1661,13 @@ | ||
| 1661 | 1661 | "CREATE TEMP TABLE xmark(tname TEXT UNIQUE, trid INT, tuuid TEXT);" |
| 1662 | 1662 | "CREATE TEMP TABLE xbranch(tname TEXT UNIQUE, brnm TEXT);" |
| 1663 | 1663 | "CREATE TEMP TABLE xtag(tname TEXT UNIQUE, tcontent TEXT);" |
| 1664 | 1664 | ); |
| 1665 | 1665 | |
| 1666 | - if(markfile_in){ | |
| 1666 | + if( markfile_in ){ | |
| 1667 | 1667 | FILE *f = fossil_fopen(markfile_in, "r"); |
| 1668 | - if(!f){ | |
| 1668 | + if( !f ){ | |
| 1669 | 1669 | fossil_fatal("cannot open %s for reading\n", markfile_in); |
| 1670 | 1670 | } |
| 1671 | 1671 | if(import_marks(f, &blobs, NULL)<0){ |
| 1672 | 1672 | fossil_fatal("error importing marks from file: %s\n", markfile_in); |
| 1673 | 1673 | } |
| @@ -1682,28 +1682,29 @@ | ||
| 1682 | 1682 | db_ephemeral_blob(&q, 0, &record); |
| 1683 | 1683 | fast_insert_content(&record, 0, 0, 1); |
| 1684 | 1684 | import_reset(0); |
| 1685 | 1685 | } |
| 1686 | 1686 | db_finalize(&q); |
| 1687 | - if(markfile_out){ | |
| 1687 | + if( markfile_out ){ | |
| 1688 | 1688 | int rid; |
| 1689 | 1689 | Stmt q_marks; |
| 1690 | 1690 | FILE *f; |
| 1691 | 1691 | 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 ){ | |
| 1693 | 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){ | |
| 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 ){ | |
| 1696 | 1697 | bag_insert(&blobs, rid); |
| 1697 | 1698 | } |
| 1698 | 1699 | }else{ |
| 1699 | 1700 | bag_insert(&vers, rid); |
| 1700 | 1701 | } |
| 1701 | 1702 | } |
| 1702 | 1703 | db_finalize(&q_marks); |
| 1703 | 1704 | f = fossil_fopen(markfile_out, "w"); |
| 1704 | - if(!f){ | |
| 1705 | + if( !f ){ | |
| 1705 | 1706 | fossil_fatal("cannot open %s for writing\n", markfile_out); |
| 1706 | 1707 | } |
| 1707 | 1708 | export_marks(f, &blobs, &vers); |
| 1708 | 1709 | fclose(f); |
| 1709 | 1710 | bag_clear(&blobs); |
| 1710 | 1711 |
| --- 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 @@ | ||
| 213 | 213 | ** -v|--verbose Show additional details of the merge |
| 214 | 214 | */ |
| 215 | 215 | void merge_cmd(void){ |
| 216 | 216 | int vid; /* Current version "V" */ |
| 217 | 217 | 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 */ | |
| 219 | 219 | int nid = 0; /* The name pivot version "N" */ |
| 220 | 220 | int verboseFlag; /* True if the -v|--verbose option is present */ |
| 221 | 221 | int integrateFlag; /* True if the --integrate option is present */ |
| 222 | 222 | int pickFlag; /* True if the --cherrypick option is present */ |
| 223 | 223 | int backoutFlag; /* True if the --backout option is present */ |
| 224 | 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; /* 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 @@ | ||
| 1183 | 1183 | } |
| 1184 | 1184 | } |
| 1185 | 1185 | |
| 1186 | 1186 | count = 0; |
| 1187 | 1187 | if( !tabs ){ |
| 1188 | - struct GenerateHTML sState; | |
| 1188 | + struct GenerateHTML sState = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; | |
| 1189 | 1189 | |
| 1190 | 1190 | db_multi_exec("PRAGMA empty_result_callbacks=ON"); |
| 1191 | 1191 | style_submenu_element("Raw", "Raw", |
| 1192 | 1192 | "rptview?tablist=1&%h", PD("QUERY_STRING","")); |
| 1193 | 1193 | if( g.perm.Admin |
| 1194 | 1194 |
| --- 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 @@ | ||
| 453 | 453 | sqlite3_value **argv |
| 454 | 454 | ){ |
| 455 | 455 | const char *zType = (const char*)sqlite3_value_text(argv[0]); |
| 456 | 456 | int rid = sqlite3_value_int(argv[1]); |
| 457 | 457 | const char *zName = (const char*)sqlite3_value_text(argv[2]); |
| 458 | - int nHdr; | |
| 458 | + int nHdr = 0; | |
| 459 | 459 | char *z = search_stext_cached(zType[0], rid, zName, &nHdr); |
| 460 | 460 | if( nHdr || zType[0]!='d' ){ |
| 461 | 461 | sqlite3_result_text(context, z, nHdr, SQLITE_TRANSIENT); |
| 462 | 462 | }else{ |
| 463 | 463 | sqlite3_result_value(context, argv[2]); |
| @@ -469,11 +469,11 @@ | ||
| 469 | 469 | sqlite3_value **argv |
| 470 | 470 | ){ |
| 471 | 471 | const char *zType = (const char*)sqlite3_value_text(argv[0]); |
| 472 | 472 | int rid = sqlite3_value_int(argv[1]); |
| 473 | 473 | const char *zName = (const char*)sqlite3_value_text(argv[2]); |
| 474 | - int nHdr; | |
| 474 | + int nHdr = 0; | |
| 475 | 475 | char *z = search_stext_cached(zType[0], rid, zName, &nHdr); |
| 476 | 476 | sqlite3_result_text(context, z+nHdr+1, -1, SQLITE_TRANSIENT); |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | /* |
| 480 | 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; |
| 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 @@ | ||
| 1266 | 1266 | }else{ |
| 1267 | 1267 | if( (g.argc!=3) && (g.argc!=4) ){ |
| 1268 | 1268 | usage("export ?FILE? --technote DATETIME|TECHNOTE-ID"); |
| 1269 | 1269 | } |
| 1270 | 1270 | rid = wiki_technote_to_rid(zETime); |
| 1271 | - if (rid == -1) { | |
| 1271 | + if ( rid==-1 ){ | |
| 1272 | 1272 | fossil_fatal("ambiguous tech note id: %s", zETime); |
| 1273 | 1273 | } |
| 1274 | 1274 | if( (pWiki = manifest_get(rid, CFTYPE_EVENT, 0))!=0 ){ |
| 1275 | 1275 | zBody = pWiki->zWiki; |
| 1276 | 1276 | } |
| @@ -1289,11 +1289,11 @@ | ||
| 1289 | 1289 | return; |
| 1290 | 1290 | }else if( strncmp(g.argv[2],"commit",n)==0 |
| 1291 | 1291 | || strncmp(g.argv[2],"create",n)==0 ){ |
| 1292 | 1292 | const char *zPageName; /* page name */ |
| 1293 | 1293 | Blob content; /* Input content */ |
| 1294 | - int rid; | |
| 1294 | + int rid = 0; | |
| 1295 | 1295 | Manifest *pWiki = 0; /* Parsed wiki page content */ |
| 1296 | 1296 | const char *zMimeType = find_option("mimetype", "M", 1); |
| 1297 | 1297 | const char *zETime = find_option("technote", "t", 1); |
| 1298 | 1298 | const char *zTags = find_option("technote-tags", NULL, 1); |
| 1299 | 1299 | const char *zClr = find_option("technote-bgcolor", NULL, 1); |
| @@ -1306,26 +1306,26 @@ | ||
| 1306 | 1306 | if( g.argc==4 ){ |
| 1307 | 1307 | blob_read_from_channel(&content, stdin, -1); |
| 1308 | 1308 | }else{ |
| 1309 | 1309 | blob_read_from_file(&content, g.argv[4]); |
| 1310 | 1310 | } |
| 1311 | - if(!zMimeType || !*zMimeType){ | |
| 1311 | + if( !zMimeType || !*zMimeType ){ | |
| 1312 | 1312 | /* Try to deduce the mime type based on the prior version. */ |
| 1313 | 1313 | if ( !zETime ){ |
| 1314 | 1314 | rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x" |
| 1315 | 1315 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'" |
| 1316 | 1316 | " ORDER BY x.mtime DESC LIMIT 1", |
| 1317 | 1317 | zPageName |
| 1318 | 1318 | ); |
| 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) ){ | |
| 1321 | 1321 | zMimeType = pWiki->zMimetype; |
| 1322 | 1322 | } |
| 1323 | 1323 | }else{ |
| 1324 | 1324 | 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) ){ | |
| 1327 | 1327 | zMimeType = pWiki->zMimetype; |
| 1328 | 1328 | } |
| 1329 | 1329 | } |
| 1330 | 1330 | }else{ |
| 1331 | 1331 | zMimeType = wiki_filter_mimetypes(zMimeType); |
| @@ -1399,11 +1399,11 @@ | ||
| 1399 | 1399 | ); |
| 1400 | 1400 | } |
| 1401 | 1401 | |
| 1402 | 1402 | while( db_step(&q)==SQLITE_ROW ){ |
| 1403 | 1403 | const char *zName = db_column_text(&q, 0); |
| 1404 | - if (showIds) { | |
| 1404 | + if( showIds ){ | |
| 1405 | 1405 | const char *zUuid = db_column_text(&q, 1); |
| 1406 | 1406 | fossil_print("%s ",zUuid); |
| 1407 | 1407 | } |
| 1408 | 1408 | fossil_print( "%s\n",zName); |
| 1409 | 1409 | } |
| 1410 | 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; |
| 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 |