Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch compiler-warnings Excluding Merge-Ins
This is equivalent to a diff from 5ad62aba37 to c71f711ec9
|
2023-02-17
| ||
| 14:57 | Fix a multitude of harmless compiler warnings. check-in: 53db40e6fc user: drh tags: trunk | |
| 14:37 | A large collection of compiler warning fixes re. signed/unsigned comparison from Daniel D. Closed-Leaf check-in: c71f711ec9 user: stephan tags: compiler-warnings | |
|
2023-02-15
| ||
| 11:26 | Reverted half of commit [4ad86dd5]: it incorrectly moved a CSS style instead of copying it to where it also needed to be. The user-visible effect was that centered Pikchrs varied in size according to their size and complexity, which meant that elements that should've been the same size weren't. check-in: 5ad62aba37 user: wyoung tags: trunk | |
| 05:16 | Cleaned up a few inconsistencies in the Pikchrs in the branching doc in an attempt to fix the smaller-and-smaller diagram size problem currently occuring in this doc. check-in: 239fb5b186 user: wyoung tags: trunk | |
Changes to extsrc/cson_amalgamation.c.
| ︙ | |||
5387 5388 5389 5390 5391 5392 5393 | 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 | - + |
cson_value * rootV = NULL;
cson_object * root = NULL;
cson_string * colName = NULL;
int i = 0;
int rc = 0;
cson_value * currentValue = NULL;
int const colCount = sqlite3_column_count(st);
|
| ︙ |
Changes to src/backoffice.c.
| ︙ | |||
539 540 541 542 543 544 545 | 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | - + |
if( backofficeSleep(1000*(x.tmCurrent - tmNow + 1)) ){
/* The sleep was interrupted by a signal from another thread. */
backofficeTrace("/***** Backoffice Interrupt %d *****/\n", GETPID());
db_end_transaction(0);
break;
}
}else{
|
| ︙ |
Changes to src/bag.c.
| ︙ | |||
99 100 101 102 103 104 105 | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | - + |
memset(p->a, 0, sizeof(p->a[0])*newSize );
for(i=0; i<old.sz; i++){
int e = old.a[i];
if( e>0 ){
unsigned h = bag_hash(e)%newSize;
while( p->a[h] ){
h++;
|
| ︙ | |||
129 130 131 132 133 134 135 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | - + |
if( p->used+1 >= p->sz/2 ){
int n = p->sz*2;
bag_resize(p, n + 20 );
}
h = bag_hash(e)%p->sz;
while( p->a[h]>0 && p->a[h]!=e ){
h++;
|
| ︙ | |||
152 153 154 155 156 157 158 | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | - + - + |
assert( e>0 );
if( p->sz==0 ){
return 0;
}
h = bag_hash(e)%p->sz;
while( p->a[h] && p->a[h]!=e ){
h++;
|
| ︙ | |||
215 216 217 218 219 220 221 | 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 | - + - + - + |
int bag_next(Bag *p, int e){
unsigned h;
assert( p->sz>0 );
assert( e>0 );
h = bag_hash(e)%p->sz;
while( p->a[h] && p->a[h]!=e ){
h++;
|
Changes to src/blob.c.
| ︙ | |||
676 677 678 679 680 681 682 | 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 | - + |
p->iCursor = 0;
}
/*
** Truncate a blob back to zero length
*/
void blob_truncate(Blob *p, int sz){
|
| ︙ | |||
1161 1162 1163 1164 1165 1166 1167 | 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 | - + |
fossil_fatal_recursive("unable to open file \"%s\" for writing",
zFilename);
return 0;
}
blob_is_init(pBlob);
nWrote = fwrite(blob_buffer(pBlob), 1, blob_size(pBlob), out);
fclose(out);
|
| ︙ | |||
1359 1360 1361 1362 1363 1364 1365 | 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 | - + |
char *z = p->aData;
int j = p->nUsed;
int i, n;
for(i=n=0; i<j; i++){
if( z[i]=='\n' ) n++;
}
j += n;
|
| ︙ | |||
1414 1415 1416 1417 1418 1419 1420 | 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 | - + |
if( (z[i]<0xa0) && (cp1252[z[i]&0x1f]>=0x800) ){
n++;
}
n++;
}
}
j += n;
|
| ︙ |
Changes to src/browse.c.
| ︙ | |||
892 893 894 895 896 897 898 | 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 | - + - + |
p = sortTreeByMtime(sTree.pFirst);
memset(&sTree, 0, sizeof(sTree));
relinkTree(&sTree, p);
}
for(p=sTree.pFirst, nDir=0; p; p=p->pNext){
const char *zLastClass = p->pSibling==0 ? " last" : "";
if( p->pChild ){
|
| ︙ |
Changes to src/capabilities.c.
| ︙ | |||
321 322 323 324 325 326 327 | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | - + - + |
static int done = 0;
Stmt q;
if( done ) return;
db_prepare(&q, "SELECT fullcap(cap) FROM user");
while( db_step(&q)==SQLITE_ROW ){
const char *zCap = db_column_text(&q, 0);
if( zCap==0 || zCap[0]==0 ) continue;
|
| ︙ |
Changes to src/cgi.c.
| ︙ | |||
2398 2399 2400 2401 2402 2403 2404 | 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 | - + |
int iPort = mnPort;
while( iPort<=mxPort ){
memset(&inaddr, 0, sizeof(inaddr));
inaddr.sin_family = AF_INET;
if( zIpAddr ){
inaddr.sin_addr.s_addr = inet_addr(zIpAddr);
|
| ︙ |
Changes to src/comformat.c.
| ︙ | |||
211 212 213 214 215 216 217 | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | - + - + - + | int cchUTF8, maxUTF8; /* Helper variables to count UTF-8 sequences. */ if( !zLine ) return; if( lineChars<=0 ) return; #if 0 assert( indent<sizeof(zBuf)-5 ); /* See following comments to explain */ assert( origIndent<sizeof(zBuf)-5 ); /* these limits. */ #endif |
| ︙ | |||
346 347 348 349 350 351 352 | 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | - + |
comment_set_maxchars(indent, &maxChars);
}
if( zText==0 ) zText = "(NULL)";
if( maxChars<=0 ){
maxChars = strlen(zText);
}
/* Ensure the buffer can hold the longest-possible UTF-8 sequences. */
|
| ︙ |
Changes to src/content.c.
| ︙ | |||
1027 1028 1029 1030 1031 1032 1033 | 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 | - + - + |
fossil_print(" %d/%d\r", n1, total);
fflush(stdout);
if( size<0 ){
fossil_print("skip phantom %d %s\n", rid, zUuid);
continue; /* Ignore phantoms */
}
content_get(rid, &content);
|
| ︙ |
Changes to src/db.c.
| ︙ | |||
4744 4745 4746 4747 4748 4749 4750 | 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 | - + |
fossil_fatal("no such setting: %s", zName);
}
if( globalFlag && fossil_strcmp(pSetting->name, "manifest")==0 ){
fossil_fatal("cannot set 'manifest' globally");
}
if( unsetFlag || g.argc==4 ){
int isManifest = fossil_strcmp(pSetting->name, "manifest")==0;
|
| ︙ |
Changes to src/delta.c.
| ︙ | |||
202 203 204 205 206 207 208 | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | - + + |
return v;
}
/*
** Return the number digits in the base-64 representation of a positive integer
*/
static int digit_count(int v){
|
| ︙ | |||
377 378 379 380 381 382 383 | 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 | - + - + | /* Compute the hash table used to locate matching sections in the ** source file. */ nHash = lenSrc/NHASH; collide = fossil_malloc( nHash*2*sizeof(int) ); memset(collide, -1, nHash*2*sizeof(int)); landmark = &collide[nHash]; |
| ︙ | |||
447 448 449 450 451 452 453 | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | - + |
cnt = j+k+1;
litsz = i-k; /* Number of bytes of literal text before the copy */
DEBUG2( printf("MATCH %d bytes at %d: [%s] litsz=%d\n",
cnt, ofst, print16(&zSrc[ofst]), litsz); )
/* sz will hold the number of bytes needed to encode the "insert"
** command and the copy command, not counting the "insert" text */
sz = digit_count(i-k)+digit_count(cnt)+digit_count(ofst)+3;
|
| ︙ | |||
479 480 481 482 483 484 485 | 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | - + - + - + |
}
base += bestCnt;
putInt(bestCnt, &zDelta);
*(zDelta++) = '@';
putInt(bestOfst, &zDelta);
DEBUG2( printf("copy %d bytes from %d\n", bestCnt, bestOfst); )
*(zDelta++) = ',';
|
| ︙ | |||
597 598 599 600 601 602 603 | 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 | - + - + |
zDelta++; lenDelta--;
DEBUG1( printf("COPY %d from %d\n", cnt, ofst); )
total += cnt;
if( total>limit ){
/* ERROR: copy exceeds output file size */
return -1;
}
|
| ︙ | |||
686 687 688 689 690 691 692 | 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 | - + |
zDelta++; lenDelta--;
nCopy += cnt;
break;
}
case ':': {
zDelta++; lenDelta--;
nInsert += cnt;
|
| ︙ |
Changes to src/deltacmd.c.
| ︙ | |||
58 59 60 61 62 63 64 | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | - + |
if( blob_read_from_file(&orig, g.argv[2], ExtFILE)<0 ){
fossil_fatal("cannot read %s", g.argv[2]);
}
if( blob_read_from_file(&target, g.argv[3], ExtFILE)<0 ){
fossil_fatal("cannot read %s", g.argv[3]);
}
blob_delta_create(&orig, &target, &delta);
|
| ︙ | |||
158 159 160 161 162 163 164 | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | - + |
fossil_fatal("cannot read %s", g.argv[2]);
}
if( blob_read_from_file(&delta, g.argv[3], ExtFILE)<0 ){
fossil_fatal("cannot read %s", g.argv[3]);
}
blob_init(&target, 0, 0);
blob_delta_apply(&orig, &delta, &target);
|
| ︙ |
Changes to src/diff.c.
| ︙ | |||
2219 2220 2221 2222 2223 2224 2225 | 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 | - + |
B = p->aTo;
R = p->aEdit;
mxr = p->nEdit;
while( mxr>2 && R[mxr-1]==0 && R[mxr-2]==0 ){ mxr -= 3; }
for(r=0; r<mxr; r += 3*nr){
/* Figure out how many triples to show in a single block */
|
| ︙ | |||
2249 2250 2251 2252 2253 2254 2255 | 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 | - + - + - + |
continue;
}
}
/* Figure out how many lines of A and B are to be displayed
** for this change block.
*/
|
| ︙ | |||
2297 2298 2299 2300 2301 2302 2303 | 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 | - + |
mb += R[r+i*3+2] + m;
}
/* Try to find an alignment for the lines within this one block */
alignment = diffBlockAlignment(&A[a], ma, &B[b], mb, pCfg, &nAlign);
for(j=0; ma+mb>0; j++){
|
| ︙ | |||
2339 2340 2341 2342 2343 2344 2345 | 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 | - + - + |
a++;
mb--;
b++;
break;
}
}
}
|
| ︙ |
Changes to src/doc.c.
| ︙ | |||
457 458 459 460 461 462 463 | 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 | - + |
#endif
z = zName;
for(i=0; zName[i]; i++){
if( zName[i]=='.' ) z = &zName[i+1];
}
len = strlen(z);
|
| ︙ |
Changes to src/encode.c.
| ︙ | |||
706 707 708 709 710 711 712 | 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 | - + |
** Return true if the input string contains only valid base-16 digits.
** If any invalid characters appear in the string, return false.
*/
int validate16(const char *zIn, int nIn){
int i;
if( nIn<0 ) nIn = (int)strlen(zIn);
if( zIn[nIn]==0 ){
|
| ︙ |
Changes to src/extcgi.c.
| ︙ | |||
113 114 115 116 117 118 119 | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | - + |
static int isDirWithIndexFile(char **pzPath){
static const char *azIndexNames[] = {
"index.html", "index.wiki", "index.md"
};
int i;
if( file_isdir(*pzPath, ExtFILE)!=1 ) return 0;
if( sqlite3_strglob("*/", *pzPath)!=0 ) return 0;
|
| ︙ | |||
270 271 272 273 274 275 276 | 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | - + - + |
char *z = mprintf("fossil version %s", get_version());
if( strncmp(zSrvSw,z,strlen(z)-4)!=0 ){
zSrvSw = mprintf("%z, %s", z, zSrvSw);
}
}
cgi_replace_parameter("SERVER_SOFTWARE", zSrvSw);
cgi_replace_parameter("GATEWAY_INTERFACE","CGI/1.0");
|
| ︙ |
Changes to src/file.c.
| ︙ | |||
201 202 203 204 205 206 207 | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | - + |
/*
** Return the mode bits for a file. Return -1 if the file does not
** exist. If zFilename is NULL return the size of the most recently
** stat-ed file.
*/
int file_mode(const char *zFilename, int eFType){
|
| ︙ | |||
240 241 242 243 244 245 246 | 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | - + |
void symlink_create(const char *zTargetFile, const char *zLinkFile){
#if !defined(_WIN32)
if( db_allow_symlinks() ){
int i, nName;
char *zName, zBuf[1000];
nName = strlen(zLinkFile);
|
| ︙ |
Changes to src/fileedit.c.
| ︙ | |||
615 616 617 618 619 620 621 | 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 | - + |
}
}else{
assert(CIMINI_CONVERT_EOL_WINDOWS & pCI->flags);
if(!(LOOK_CRLF & lookNew)){
blob_add_cr(&pCI->fileContent);
}
}
|
| ︙ |
Changes to src/forum.c.
| ︙ | |||
702 703 704 705 706 707 708 | 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 | - + |
if( bHist ){
zQuery[i] = i==0 ? '?' : '&'; i++;
zQuery[i++] = 'h';
zQuery[i++] = 'i';
zQuery[i++] = 's';
zQuery[i++] = 't';
}
|
| ︙ |
Changes to src/http_ssl.c.
| ︙ | |||
539 540 541 542 543 544 545 | 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 | - + |
/* MMNNFFPPS */
#if OPENSSL_VERSION_NUMBER >= 0x010000000
x = X509_digest(cert, EVP_sha256(), md, &mdLength);
#else
x = X509_digest(cert, EVP_sha1(), md, &mdLength);
#endif
if( x ){
|
| ︙ |
Changes to src/http_transport.c.
| ︙ | |||
80 81 82 83 84 85 86 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | - + |
** Check zFossil to see if it is a reasonable "fossil" command to
** run on the server. Do not allow an attacker to substitute something
** like "/bin/rm".
*/
static int is_safe_fossil_command(const char *zFossil){
static const char *const azSafe[] = { "*/fossil", "*/fossil.exe", "*/echo" };
int i;
|
| ︙ |
Changes to src/import.c.
| ︙ | |||
595 596 597 598 599 600 601 | 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 | - + |
** tag to the new commit. However, if there are multiple instances
** of pattern B with the same TAGNAME, then only put the tag on the
** last commit that holds that tag.
**
** None of the above is explained in the git-fast-export
** documentation. We had to figure it out via trial and error.
*/
|
| ︙ | |||
765 766 767 768 769 770 771 | 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 | - + |
i = 0;
mx = gg.nFile;
nFrom = strlen(zFrom);
while( (pFile = import_find_file(zFrom, &i, mx))!=0 ){
if( pFile->isFrom==0 ) continue;
pNew = import_add_file();
pFile = &gg.aFile[i-1];
|
| ︙ | |||
788 789 790 791 792 793 794 | 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 | - + |
zTo = rest_of_line(&z);
i = 0;
nFrom = strlen(zFrom);
while( (pFile = import_find_file(zFrom, &i, gg.nFile))!=0 ){
if( pFile->isFrom==0 ) continue;
pNew = import_add_file();
pFile = &gg.aFile[i-1];
|
| ︙ | |||
1011 1012 1013 1014 1015 1016 1017 | 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 | - + |
svn_read_props(pIn, rec);
blob_zero(&rec->content);
zLen = svn_find_header(*rec, "Text-content-length");
if( zLen ){
rec->contentFlag = 1;
nLen = atoi(zLen);
blob_read_from_channel(&rec->content, pIn, nLen);
|
| ︙ | |||
1276 1277 1278 1279 1280 1281 1282 | 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 | - + |
char *zBranch = 0;
int branchId = 0;
if( gsvn.azIgnTree ){
const char **pzIgnTree;
unsigned nPath = strlen(zPath);
for( pzIgnTree = gsvn.azIgnTree; *pzIgnTree; ++pzIgnTree ){
const char *zIgn = *pzIgnTree;
|
| ︙ |
Changes to src/lookslike.c.
| ︙ | |||
341 342 343 344 345 346 347 | 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | - + |
*/
int starts_with_utf8_bom(const Blob *pContent, int *pnByte){
const char *z = blob_buffer(pContent);
int bomSize = 0;
const unsigned char *bom = get_utf8_bom(&bomSize);
if( pnByte ) *pnByte = bomSize;
|
| ︙ |
Changes to src/main.c.
| ︙ | |||
425 426 427 428 429 430 431 | 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | - + - + - + - + | const char *zFileName; /* input file name */ FILE *inFile; /* input FILE */ g.argc = argc; g.argv = argv; sqlite3_initialize(); #if defined(_WIN32) && defined(BROKEN_MINGW_CMDLINE) |
| ︙ | |||
504 505 506 507 508 509 510 | 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | - + |
z[k] = 0;
k++;
if( z[k] ) newArgv[j++] = &z[k];
}
}
}
i += 2;
|
| ︙ | |||
1759 1760 1761 1762 1763 1764 1765 | 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 | - + |
#endif
if( c=='/' ) continue;
if( c=='_' ) continue;
if( c=='-' && zRepo[j-1]!='/' ) continue;
if( c=='.' && fossil_isalnum(zRepo[j-1]) && fossil_isalnum(zRepo[j+1])){
continue;
}
|
| ︙ |
Changes to src/markdown.c.
| ︙ | |||
394 395 396 397 398 399 400 | 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | - + |
/* release the given working buffer back to the cache */
static void release_work_buffer(struct render *rndr, struct Blob *buf){
if( !buf ) return;
rndr->iDepth--;
blob_reset(buf);
|
| ︙ | |||
1568 1569 1570 1571 1572 1573 1574 | 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 | - + - + |
/* Return the number of characters in the delimiter of a fenced code
** block. */
static size_t prefix_fencedcode(char *data, size_t size){
char c = data[0];
int nb;
if( c!='`' && c!='~' ) return 0;
|
| ︙ | |||
1685 1686 1687 1688 1689 1690 1691 | 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 | - + |
size_t i = 0, end = 0;
int level = 0;
char *work_data = data;
size_t work_size = 0;
while( i<size ){
char *zEnd = memchr(data+i, '\n', size-i-1);
|
| ︙ | |||
1758 1759 1760 1761 1762 1763 1764 | 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 | - + |
){
size_t beg, end, pre;
struct Blob *work = new_work_buffer(rndr);
beg = 0;
while( beg<size ){
char *zEnd = memchr(data+beg, '\n', size-beg-1);
|
| ︙ | |||
1968 1969 1970 1971 1972 1973 1974 | 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 | - + - + |
size_t size
){
int level = 0;
size_t i, end, skip, span_beg, span_size;
if( !size || data[0]!='#' ) return 0;
|
| ︙ | |||
2003 2004 2005 2006 2007 2008 2009 | 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 | - + |
size_t size
){
size_t i, w;
/* assuming data[0]=='<' && data[1]=='/' already tested */
/* checking tag is a match */
|
| ︙ | |||
2633 2634 2635 2636 2637 2638 2639 | 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 | + - + |
void markdown(
struct Blob *ob, /* output blob for rendered text */
const struct Blob *ib, /* input blob in markdown */
const struct mkd_renderer *rndrer /* renderer descriptor (callbacks) */
){
struct link_ref *lr;
struct footnote *fn;
int i;
|
| ︙ | |||
2717 2718 2719 2720 2721 2722 2723 | 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 | + - + - + - + - + |
int nDups = 0;
fn = CAST_AS_FOOTNOTES( allNotes );
qsort(fn, rndr.notes.nLbled, sizeof(struct footnote), cmp_footnote_id);
/* concatenate footnotes with equal labels */
for(i=0; i<rndr.notes.nLbled ;){
struct footnote *x = fn + i;
int j = i+1;
|
| ︙ | |||
2828 2829 2830 2831 2832 2833 2834 | 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 | - + - + - + - + |
/* Assert that the in-memory layout of id, text and upc within
** footnote struct matches the expectations of html_footnote_item()
** If it doesn't then a compiler has done something very weird.
*/
assert( &(rndr.notes.misref.id) == &(rndr.notes.misref.text) - 1 );
assert( &(rndr.notes.misref.upc) == &(rndr.notes.misref.text) + 1 );
|
Changes to src/merge3.c.
| ︙ | |||
454 455 456 457 458 459 460 | 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 | - + |
if( blob_read_from_file(&v1, g.argv[3], ExtFILE)<0 ){
fossil_fatal("cannot read %s", g.argv[3]);
}
if( blob_read_from_file(&v2, g.argv[4], ExtFILE)<0 ){
fossil_fatal("cannot read %s", g.argv[4]);
}
nConflict = blob_merge(&pivot, &v1, &v2, &merged);
|
| ︙ |
Changes to src/printf.c.
| ︙ | |||
862 863 864 865 866 867 868 | 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 | - + - + |
** the output.
*/
if( !flag_leftjustify ){
register int nspace;
nspace = width-length;
if( nspace>0 ){
count += nspace;
|
| ︙ |
Changes to src/rebuild.c.
| ︙ | |||
254 255 256 257 258 259 260 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | - + |
Blob copy;
Blob *pUse;
int nChild, i, cid;
while( rid>0 ){
/* Fix up the "blob.size" field if needed. */
|
| ︙ |
Changes to src/tar.c.
| ︙ | |||
244 245 246 247 248 249 250 | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | - + |
/* adding the length extended the length field? */
if(blen > next10){
blen++;
}
/* build the string */
blob_appendf(&tball.pax, "%d %s=%*.*s\n", blen, zField, nValue, nValue, zValue);
/* this _must_ be right */
|
| ︙ |
Changes to src/th.c.
| ︙ | |||
851 852 853 854 855 856 857 | 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 | - + |
zWord = Th_GetResult(interp, &nWord);
thBufferWrite(interp, &strbuf, zWord, nWord);
thBufferAddChar(interp, &strbuf, 0);
thBufferWrite(interp, &lenbuf, &nWord, sizeof(int));
nCount++;
}
}
|
| ︙ |
Changes to src/th_main.c.
| ︙ | |||
1847 1848 1849 1850 1851 1852 1853 | 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 | - + |
return Th_WrongNumArgs(interp, "repository ?BOOLEAN?");
}
if( argc==2 ){
if( Th_ToInt(interp, argv[1], argl[1], &n) ){
return TH_ERROR;
}
if( n<1 ) n = 1;
|
| ︙ |
Changes to src/timeline.c.
| ︙ | |||
545 546 547 548 549 550 551 | 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 | - + |
if( z[ii]=='\n' ){
for(jj=ii+1; jj<n && z[jj]!='\n' && fossil_isspace(z[jj]); jj++){}
if( z[jj]=='\n' ) break;
}
}
z[ii] = 0;
cgi_printf("%W",z);
|
| ︙ | |||
3430 3431 3432 3433 3434 3435 3436 | 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 | - + |
z = db_text(0, "SELECT date(%Q,'+1 day')", zToday);
style_submenu_element("Tomorrow", "%R/thisdayinhistory?today=%t", z);
zStartOfProject = db_text(0,
"SELECT datetime(min(mtime),toLocal(),'startofday') FROM event;"
);
timeline_temp_table();
db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
|
| ︙ |
Changes to src/tkt.c.
| ︙ | |||
924 925 926 927 928 929 930 | 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 | - + |
int nValue;
if( aField[i].zAppend ) continue;
zValue = Th_Fetch(aField[i].zName, &nValue);
if( zValue ){
while( nValue>0 && fossil_isspace(zValue[nValue-1]) ){ nValue--; }
if( ((aField[i].mUsed & USEDBY_TICKETCHNG)!=0 && nValue>0)
|| memcmp(zValue, aField[i].zValue, nValue)!=0
|
| ︙ |
Changes to src/user.c.
| ︙ | |||
155 156 157 158 159 160 161 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | - + | unsigned char zB[30]; int nA = 25; int nB = 0; int i; memcpy(zOrig, "abcdefghijklmnopqrstuvwyz", nA+1); memcpy(zA, zOrig, nA+1); assert( nA==(int)strlen((char*)zA) ); |
| ︙ |
Changes to src/util.c.
| ︙ | |||
678 679 680 681 682 683 684 | 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 | - + - + |
&& ( zTempDirA = fossil_path_to_utf8(zTempDirW) )){
zDir = zTempDirA;
}else{
zDir = fossil_getenv("LOCALAPPDATA");
if( zDir==0 ) zDir = ".";
}
#else
|
| ︙ |
Changes to src/wikiformat.c.
| ︙ | |||
788 789 790 791 792 793 794 | 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 | - + |
i = 2;
}else{
p->endTag = 0;
i = 1;
}
j = 0;
while( fossil_isalnum(z[i]) ){
|
| ︙ | |||
811 812 813 814 815 816 817 | 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 | - + |
if( c=='>' ) return 0;
}
while( fossil_isspace(z[i]) ){ i++; }
while( c!='>' && p->nAttr<8 && fossil_isalpha(z[i]) ){
int attrOk; /* True to preserve attribute. False to ignore it */
j = 0;
while( fossil_isalnum(z[i]) ){
|
| ︙ | |||
1103 1104 1105 1106 1107 1108 1109 | 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 | - + |
int n;
char zU2[HNAME_MAX+1];
db_static_prepare(&q,
"SELECT 1 FROM blob WHERE uuid>=:u AND uuid<:u2"
);
db_bind_text(&q, ":u", zUuid);
n = (int)strlen(zUuid);
|
| ︙ | |||
1356 1357 1358 1359 1360 1361 1362 | 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 | - + |
/* Also ignore the link if various flags are set */
zTerm = "";
}else{
blob_appendf(pOut, "<span class=\"brokenlink\">[%h]", zTarget);
zTerm = "</span>";
}
if( zExtra ) fossil_free(zExtra);
|
| ︙ |
Changes to src/xfer.c.
| ︙ | |||
448 449 450 451 452 453 454 | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | - + |
if( srcId>0
&& (pXfer->syncPrivate || !content_is_private(srcId))
&& content_get(srcId, &src)
){
char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", srcId);
blob_delta_create(&src, pContent, &delta);
size = blob_size(&delta);
|
| ︙ | |||
575 576 577 578 579 580 581 | 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 | - + |
pUuid = &uuid;
}
if( uuid_is_shunned(blob_str(pUuid)) ){
blob_reset(&uuid);
return;
}
if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) ||
|
| ︙ | |||
699 700 701 702 703 704 705 | 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 | - + - + |
static void send_unversioned_file(
Xfer *pXfer, /* Transfer context */
const char *zName, /* Name of unversioned file to be sent */
int noContent /* True to omit the content */
){
Stmt q1;
|
| ︙ | |||
1027 1028 1029 1030 1031 1032 1033 | 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 | - + |
" AND NOT EXISTS(SELECT 1 FROM private WHERE rid=blob.rid)%s",
zExtra /*safe-for-%s*/
);
}
while( db_step(&q)==SQLITE_ROW ){
blob_appendf(pXfer->pOut, "igot %s\n", db_column_text(&q, 0));
cnt++;
|
| ︙ | |||
1455 1456 1457 1458 1459 1460 1461 | 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 | - + |
){
int seqno, max;
if( iVers>=3 ){
cgi_set_content_type("application/x-fossil-uncompressed");
}
blob_is_int(&xfer.aToken[2], &seqno);
max = db_int(0, "SELECT max(rid) FROM blob");
|
| ︙ | |||
2226 2227 2228 2229 2230 2231 2232 | 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 | - + |
send_unversioned_file(&xfer, zName, db_column_int(&uvq,1));
nCardSent++;
nArtifactSent++;
db_multi_exec("DELETE FROM uv_tosend WHERE name=%Q", zName);
if( syncFlags & SYNC_VERBOSE ){
fossil_print("\rUnversioned-file sent: %s\n", zName);
}
|
| ︙ |
Changes to src/zip.c.
| ︙ | |||
64 65 66 67 68 69 70 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | - + |
sqlite3_vfs vfs; /* VFS object */
};
/*
** Ensure that blob pBlob is at least nMin bytes in size.
*/
static void zip_blob_minsize(Blob *pBlob, int nMin){
|
| ︙ | |||
439 440 441 442 443 444 445 | 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | - + - + |
if( mPerm==PERM_LNK ){
sqlite3_bind_int(p->pInsert, 2, 0120755);
sqlite3_bind_int(p->pInsert, 4, -1);
sqlite3_bind_text(p->pInsert, 5,
blob_buffer(pFile), blob_size(pFile), SQLITE_STATIC
);
}else{
|
| ︙ |