Fossil SCM

Some optimizations. No change in functionality. - In clean_cmd, use new function vfile_scan2. - When checking for multiple bytes/characters always do that in order of likelihood: '\n' is more likely than '\0', which is more likely than '\r'. - Off-by-one error in looks_like_utf16(). - Allow starts_with_utf16_bom() to be used in detecting UTF-16 without BOM as well: Always determine pbReverse, even if no BOM is present. - Remove unused variable.

jan.nijtmans 2013-05-13 09:12 trunk
Commit fa506944056737fddefcee01652f6e12e75b9a53
3 files changed +2 -3 +28 -19 -3
+2 -3
--- src/checkin.c
+++ src/checkin.c
@@ -447,12 +447,13 @@
447447
n = strlen(g.zLocalRoot);
448448
blob_init(&path, g.zLocalRoot, n-1);
449449
pIgnore = glob_create(zIgnoreFlag);
450450
pKeep = glob_create(zKeepFlag);
451451
pClean = glob_create(zCleanFlag);
452
- vfile_scan(&path, blob_size(&path), scanFlags, pKeep);
452
+ vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep);
453453
glob_free(pKeep);
454
+ glob_free(pIgnore);
454455
db_prepare(&q,
455456
"SELECT %Q || x FROM sfile"
456457
" WHERE x NOT IN (%s)"
457458
" ORDER BY 1",
458459
g.zLocalRoot, fossil_all_reserved_names(0)
@@ -461,11 +462,10 @@
461462
db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
462463
}
463464
db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
464465
while( db_step(&q)==SQLITE_ROW ){
465466
const char *zName = db_column_text(&q, 0);
466
- if( glob_match(pIgnore, zName+n) ) continue;
467467
if( !allFlag && !glob_match(pClean, zName+n) ){
468468
Blob ans;
469469
char cReply;
470470
char *prompt = mprintf("remove unmanaged file \"%s\" (a=all/y/N)? ",
471471
zName+n);
@@ -482,11 +482,10 @@
482482
if( !dryRunFlag ){
483483
file_delete(zName);
484484
}
485485
}
486486
glob_free(pClean);
487
- glob_free(pIgnore);
488487
db_finalize(&q);
489488
}
490489
491490
/*
492491
** Prompt the user for a check-in or stash comment (given in pPrompt),
493492
--- src/checkin.c
+++ src/checkin.c
@@ -447,12 +447,13 @@
447 n = strlen(g.zLocalRoot);
448 blob_init(&path, g.zLocalRoot, n-1);
449 pIgnore = glob_create(zIgnoreFlag);
450 pKeep = glob_create(zKeepFlag);
451 pClean = glob_create(zCleanFlag);
452 vfile_scan(&path, blob_size(&path), scanFlags, pKeep);
453 glob_free(pKeep);
 
454 db_prepare(&q,
455 "SELECT %Q || x FROM sfile"
456 " WHERE x NOT IN (%s)"
457 " ORDER BY 1",
458 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -461,11 +462,10 @@
461 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
462 }
463 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
464 while( db_step(&q)==SQLITE_ROW ){
465 const char *zName = db_column_text(&q, 0);
466 if( glob_match(pIgnore, zName+n) ) continue;
467 if( !allFlag && !glob_match(pClean, zName+n) ){
468 Blob ans;
469 char cReply;
470 char *prompt = mprintf("remove unmanaged file \"%s\" (a=all/y/N)? ",
471 zName+n);
@@ -482,11 +482,10 @@
482 if( !dryRunFlag ){
483 file_delete(zName);
484 }
485 }
486 glob_free(pClean);
487 glob_free(pIgnore);
488 db_finalize(&q);
489 }
490
491 /*
492 ** Prompt the user for a check-in or stash comment (given in pPrompt),
493
--- src/checkin.c
+++ src/checkin.c
@@ -447,12 +447,13 @@
447 n = strlen(g.zLocalRoot);
448 blob_init(&path, g.zLocalRoot, n-1);
449 pIgnore = glob_create(zIgnoreFlag);
450 pKeep = glob_create(zKeepFlag);
451 pClean = glob_create(zCleanFlag);
452 vfile_scan2(&path, blob_size(&path), scanFlags, pIgnore, pKeep);
453 glob_free(pKeep);
454 glob_free(pIgnore);
455 db_prepare(&q,
456 "SELECT %Q || x FROM sfile"
457 " WHERE x NOT IN (%s)"
458 " ORDER BY 1",
459 g.zLocalRoot, fossil_all_reserved_names(0)
@@ -461,11 +462,10 @@
462 db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
463 }
464 db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
465 while( db_step(&q)==SQLITE_ROW ){
466 const char *zName = db_column_text(&q, 0);
 
467 if( !allFlag && !glob_match(pClean, zName+n) ){
468 Blob ans;
469 char cReply;
470 char *prompt = mprintf("remove unmanaged file \"%s\" (a=all/y/N)? ",
471 zName+n);
@@ -482,11 +482,10 @@
482 if( !dryRunFlag ){
483 file_delete(zName);
484 }
485 }
486 glob_free(pClean);
 
487 db_finalize(&q);
488 }
489
490 /*
491 ** Prompt the user for a check-in or stash comment (given in pPrompt),
492
+28 -19
--- src/diff.c
+++ src/diff.c
@@ -243,26 +243,25 @@
243243
unsigned int n = blob_size(pContent);
244244
int j, c, flags = LOOK_NONE; /* Assume UTF-8 text, prove otherwise */
245245
246246
if( n==0 ) return flags; /* Empty file -> text */
247247
c = *z;
248
- if( c==0 ){
248
+ j = (c!='\n');
249
+ if( !j ){
250
+ flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
251
+ }else if( c==0 ){
249252
flags |= LOOK_NUL; /* NUL character in a file -> binary */
250253
}else if( c=='\r' ){
251254
flags |= LOOK_CR;
252255
if( n<=1 || z[1]!='\n' ){
253256
flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
254257
}
255258
}
256
- j = (c!='\n');
257
- if( !j ) flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
258259
while( !(flags&stopFlags) && --n>0 ){
259260
int c2 = c;
260261
c = *++z; ++j;
261
- if( c==0 ){
262
- flags |= LOOK_NUL; /* NUL character in a file -> binary */
263
- }else if( c=='\n' ){
262
+ if( c=='\n' ){
264263
flags |= LOOK_LF;
265264
if( c2=='\r' ){
266265
flags |= (LOOK_CR | LOOK_CRLF); /* Found LF preceded by CR */
267266
}else{
268267
flags |= LOOK_LONE_LF;
@@ -269,10 +268,12 @@
269268
}
270269
if( j>LENGTH_MASK ){
271270
flags |= LOOK_LONG; /* Very long line -> binary */
272271
}
273272
j = 0;
273
+ }else if( c==0 ){
274
+ flags |= LOOK_NUL; /* NUL character in a file -> binary */
274275
}else if( c=='\r' ){
275276
flags |= LOOK_CR;
276277
if( n<=1 || z[1]!='\n' ){
277278
flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
278279
}
@@ -357,32 +358,31 @@
357358
}
358359
c = *z;
359360
if( bReverse ){
360361
c = UTF16_SWAP(c);
361362
}
362
- if( c==0 ){
363
+ j = (c!='\n');
364
+ if( !j ){
365
+ flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
366
+ }else if( c==0 ){
363367
flags |= LOOK_NUL; /* NUL character in a file -> binary */
364368
}else if( c=='\r' ){
365369
flags |= LOOK_CR;
366370
if( n<=sizeof(WCHAR_T) || UTF16_SWAP_IF(bReverse, z[1])!='\n' ){
367371
flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
368372
}
369373
}
370
- j = (c!='\n');
371
- if( !j ) flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
372374
while( 1 ){
373375
int c2 = c;
374376
n -= sizeof(WCHAR_T);
375377
if( (flags&stopFlags) || n<sizeof(WCHAR_T) ) break;
376378
c = *++z;
377379
if( bReverse ){
378380
c = UTF16_SWAP(c);
379381
}
380382
++j;
381
- if( c==0 ){
382
- flags |= LOOK_NUL; /* NUL character in a file -> binary */
383
- }else if( c=='\n' ){
383
+ if( c=='\n' ){
384384
flags |= LOOK_LF;
385385
if( c2=='\r' ){
386386
flags |= (LOOK_CR | LOOK_CRLF); /* Found LF preceded by CR */
387387
}else{
388388
flags |= LOOK_LONE_LF;
@@ -389,13 +389,15 @@
389389
}
390390
if( j>UTF16_LENGTH_MASK ){
391391
flags |= LOOK_LONG; /* Very long line -> binary */
392392
}
393393
j = 0;
394
+ }else if( c==0 ){
395
+ flags |= LOOK_NUL; /* NUL character in a file -> binary */
394396
}else if( c=='\r' ){
395397
flags |= LOOK_CR;
396
- if( n<=sizeof(WCHAR_T) || UTF16_SWAP_IF(bReverse, z[1])!='\n' ){
398
+ if( n<2*sizeof(WCHAR_T) || UTF16_SWAP_IF(bReverse, z[1])!='\n' ){
397399
flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
398400
}
399401
}
400402
}
401403
if( n ){
@@ -436,28 +438,35 @@
436438
/*
437439
** This function returns non-zero if the blob starts with a UTF-16
438440
** byte-order-mark (BOM), either in the endianness of the machine
439441
** or in reversed byte order. The UTF-32 BOM is ruled out by checking
440442
** if the UTF-16 BOM is not immediately followed by (utf16) 0.
441
-** pnByte and pbReverse are only set when the function returns 1.
443
+** pnByte is only set when the function returns 1.
444
+**
445
+** pbReverse is always set, even when no BOM is found. Without BOM,
446
+** it is set to 1 on little-endian and 0 on big-endian platforms. See
447
+** clause D98 of conformance (section 3.10) of the Unicode standard.
442448
*/
443449
int starts_with_utf16_bom(
444450
const Blob *pContent, /* IN: Blob content to perform BOM detection on. */
445451
int *pnByte, /* OUT: The number of bytes used for the BOM. */
446452
int *pbReverse /* OUT: Non-zero for BOM in reverse byte-order. */
447453
){
448454
const unsigned short *z = (unsigned short *)blob_buffer(pContent);
449455
int bomSize = sizeof(unsigned short);
450456
int size = blob_size(pContent);
457
+ static const int one = 1;
451458
452
- if( size<bomSize ) return 0; /* No: cannot read BOM. */
453
- if( size>=(2*bomSize) && z[1]==0 ) return 0; /* No: possible UTF-32. */
454
- if( z[0]==0xfffe ){
459
+ if( size<bomSize ) goto noBom; /* No: cannot read BOM. */
460
+ if( size>=(2*bomSize) && z[1]==0 ) goto noBom; /* No: possible UTF-32. */
461
+ if( z[0]==0xfeff ){
462
+ if( pbReverse ) *pbReverse = 0;
463
+ }else if( z[0]==0xfffe ){
455464
if( pbReverse ) *pbReverse = 1;
456
- }else if( z[0]==0xfeff ){
457
- if( pbReverse ) *pbReverse = 0;
458465
}else{
466
+ noBom:
467
+ if( pbReverse ) *pbReverse = *(char *) &one;
459468
return 0; /* No: UTF-16 byte-order-mark not found. */
460469
}
461470
if( pnByte ) *pnByte = bomSize;
462471
return 1; /* Yes. */
463472
}
464473
--- src/diff.c
+++ src/diff.c
@@ -243,26 +243,25 @@
243 unsigned int n = blob_size(pContent);
244 int j, c, flags = LOOK_NONE; /* Assume UTF-8 text, prove otherwise */
245
246 if( n==0 ) return flags; /* Empty file -> text */
247 c = *z;
248 if( c==0 ){
 
 
 
249 flags |= LOOK_NUL; /* NUL character in a file -> binary */
250 }else if( c=='\r' ){
251 flags |= LOOK_CR;
252 if( n<=1 || z[1]!='\n' ){
253 flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
254 }
255 }
256 j = (c!='\n');
257 if( !j ) flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
258 while( !(flags&stopFlags) && --n>0 ){
259 int c2 = c;
260 c = *++z; ++j;
261 if( c==0 ){
262 flags |= LOOK_NUL; /* NUL character in a file -> binary */
263 }else if( c=='\n' ){
264 flags |= LOOK_LF;
265 if( c2=='\r' ){
266 flags |= (LOOK_CR | LOOK_CRLF); /* Found LF preceded by CR */
267 }else{
268 flags |= LOOK_LONE_LF;
@@ -269,10 +268,12 @@
269 }
270 if( j>LENGTH_MASK ){
271 flags |= LOOK_LONG; /* Very long line -> binary */
272 }
273 j = 0;
 
 
274 }else if( c=='\r' ){
275 flags |= LOOK_CR;
276 if( n<=1 || z[1]!='\n' ){
277 flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
278 }
@@ -357,32 +358,31 @@
357 }
358 c = *z;
359 if( bReverse ){
360 c = UTF16_SWAP(c);
361 }
362 if( c==0 ){
 
 
 
363 flags |= LOOK_NUL; /* NUL character in a file -> binary */
364 }else if( c=='\r' ){
365 flags |= LOOK_CR;
366 if( n<=sizeof(WCHAR_T) || UTF16_SWAP_IF(bReverse, z[1])!='\n' ){
367 flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
368 }
369 }
370 j = (c!='\n');
371 if( !j ) flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
372 while( 1 ){
373 int c2 = c;
374 n -= sizeof(WCHAR_T);
375 if( (flags&stopFlags) || n<sizeof(WCHAR_T) ) break;
376 c = *++z;
377 if( bReverse ){
378 c = UTF16_SWAP(c);
379 }
380 ++j;
381 if( c==0 ){
382 flags |= LOOK_NUL; /* NUL character in a file -> binary */
383 }else if( c=='\n' ){
384 flags |= LOOK_LF;
385 if( c2=='\r' ){
386 flags |= (LOOK_CR | LOOK_CRLF); /* Found LF preceded by CR */
387 }else{
388 flags |= LOOK_LONE_LF;
@@ -389,13 +389,15 @@
389 }
390 if( j>UTF16_LENGTH_MASK ){
391 flags |= LOOK_LONG; /* Very long line -> binary */
392 }
393 j = 0;
 
 
394 }else if( c=='\r' ){
395 flags |= LOOK_CR;
396 if( n<=sizeof(WCHAR_T) || UTF16_SWAP_IF(bReverse, z[1])!='\n' ){
397 flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
398 }
399 }
400 }
401 if( n ){
@@ -436,28 +438,35 @@
436 /*
437 ** This function returns non-zero if the blob starts with a UTF-16
438 ** byte-order-mark (BOM), either in the endianness of the machine
439 ** or in reversed byte order. The UTF-32 BOM is ruled out by checking
440 ** if the UTF-16 BOM is not immediately followed by (utf16) 0.
441 ** pnByte and pbReverse are only set when the function returns 1.
 
 
 
 
442 */
443 int starts_with_utf16_bom(
444 const Blob *pContent, /* IN: Blob content to perform BOM detection on. */
445 int *pnByte, /* OUT: The number of bytes used for the BOM. */
446 int *pbReverse /* OUT: Non-zero for BOM in reverse byte-order. */
447 ){
448 const unsigned short *z = (unsigned short *)blob_buffer(pContent);
449 int bomSize = sizeof(unsigned short);
450 int size = blob_size(pContent);
 
451
452 if( size<bomSize ) return 0; /* No: cannot read BOM. */
453 if( size>=(2*bomSize) && z[1]==0 ) return 0; /* No: possible UTF-32. */
454 if( z[0]==0xfffe ){
 
 
455 if( pbReverse ) *pbReverse = 1;
456 }else if( z[0]==0xfeff ){
457 if( pbReverse ) *pbReverse = 0;
458 }else{
 
 
459 return 0; /* No: UTF-16 byte-order-mark not found. */
460 }
461 if( pnByte ) *pnByte = bomSize;
462 return 1; /* Yes. */
463 }
464
--- src/diff.c
+++ src/diff.c
@@ -243,26 +243,25 @@
243 unsigned int n = blob_size(pContent);
244 int j, c, flags = LOOK_NONE; /* Assume UTF-8 text, prove otherwise */
245
246 if( n==0 ) return flags; /* Empty file -> text */
247 c = *z;
248 j = (c!='\n');
249 if( !j ){
250 flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
251 }else if( c==0 ){
252 flags |= LOOK_NUL; /* NUL character in a file -> binary */
253 }else if( c=='\r' ){
254 flags |= LOOK_CR;
255 if( n<=1 || z[1]!='\n' ){
256 flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
257 }
258 }
 
 
259 while( !(flags&stopFlags) && --n>0 ){
260 int c2 = c;
261 c = *++z; ++j;
262 if( c=='\n' ){
 
 
263 flags |= LOOK_LF;
264 if( c2=='\r' ){
265 flags |= (LOOK_CR | LOOK_CRLF); /* Found LF preceded by CR */
266 }else{
267 flags |= LOOK_LONE_LF;
@@ -269,10 +268,12 @@
268 }
269 if( j>LENGTH_MASK ){
270 flags |= LOOK_LONG; /* Very long line -> binary */
271 }
272 j = 0;
273 }else if( c==0 ){
274 flags |= LOOK_NUL; /* NUL character in a file -> binary */
275 }else if( c=='\r' ){
276 flags |= LOOK_CR;
277 if( n<=1 || z[1]!='\n' ){
278 flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
279 }
@@ -357,32 +358,31 @@
358 }
359 c = *z;
360 if( bReverse ){
361 c = UTF16_SWAP(c);
362 }
363 j = (c!='\n');
364 if( !j ){
365 flags |= (LOOK_LF | LOOK_LONE_LF); /* Found LF as first char */
366 }else if( c==0 ){
367 flags |= LOOK_NUL; /* NUL character in a file -> binary */
368 }else if( c=='\r' ){
369 flags |= LOOK_CR;
370 if( n<=sizeof(WCHAR_T) || UTF16_SWAP_IF(bReverse, z[1])!='\n' ){
371 flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
372 }
373 }
 
 
374 while( 1 ){
375 int c2 = c;
376 n -= sizeof(WCHAR_T);
377 if( (flags&stopFlags) || n<sizeof(WCHAR_T) ) break;
378 c = *++z;
379 if( bReverse ){
380 c = UTF16_SWAP(c);
381 }
382 ++j;
383 if( c=='\n' ){
 
 
384 flags |= LOOK_LF;
385 if( c2=='\r' ){
386 flags |= (LOOK_CR | LOOK_CRLF); /* Found LF preceded by CR */
387 }else{
388 flags |= LOOK_LONE_LF;
@@ -389,13 +389,15 @@
389 }
390 if( j>UTF16_LENGTH_MASK ){
391 flags |= LOOK_LONG; /* Very long line -> binary */
392 }
393 j = 0;
394 }else if( c==0 ){
395 flags |= LOOK_NUL; /* NUL character in a file -> binary */
396 }else if( c=='\r' ){
397 flags |= LOOK_CR;
398 if( n<2*sizeof(WCHAR_T) || UTF16_SWAP_IF(bReverse, z[1])!='\n' ){
399 flags |= LOOK_LONE_CR; /* More chars, next char is not LF */
400 }
401 }
402 }
403 if( n ){
@@ -436,28 +438,35 @@
438 /*
439 ** This function returns non-zero if the blob starts with a UTF-16
440 ** byte-order-mark (BOM), either in the endianness of the machine
441 ** or in reversed byte order. The UTF-32 BOM is ruled out by checking
442 ** if the UTF-16 BOM is not immediately followed by (utf16) 0.
443 ** pnByte is only set when the function returns 1.
444 **
445 ** pbReverse is always set, even when no BOM is found. Without BOM,
446 ** it is set to 1 on little-endian and 0 on big-endian platforms. See
447 ** clause D98 of conformance (section 3.10) of the Unicode standard.
448 */
449 int starts_with_utf16_bom(
450 const Blob *pContent, /* IN: Blob content to perform BOM detection on. */
451 int *pnByte, /* OUT: The number of bytes used for the BOM. */
452 int *pbReverse /* OUT: Non-zero for BOM in reverse byte-order. */
453 ){
454 const unsigned short *z = (unsigned short *)blob_buffer(pContent);
455 int bomSize = sizeof(unsigned short);
456 int size = blob_size(pContent);
457 static const int one = 1;
458
459 if( size<bomSize ) goto noBom; /* No: cannot read BOM. */
460 if( size>=(2*bomSize) && z[1]==0 ) goto noBom; /* No: possible UTF-32. */
461 if( z[0]==0xfeff ){
462 if( pbReverse ) *pbReverse = 0;
463 }else if( z[0]==0xfffe ){
464 if( pbReverse ) *pbReverse = 1;
 
 
465 }else{
466 noBom:
467 if( pbReverse ) *pbReverse = *(char *) &one;
468 return 0; /* No: UTF-16 byte-order-mark not found. */
469 }
470 if( pnByte ) *pnByte = bomSize;
471 return 1; /* Yes. */
472 }
473
-3
--- src/main.c
+++ src/main.c
@@ -513,11 +513,10 @@
513513
#endif
514514
{
515515
const char *zCmdName = "unknown";
516516
int idx;
517517
int rc;
518
- int timerId;
519518
sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
520519
memset(&g, 0, sizeof(g));
521520
g.now = time(0);
522521
#ifdef FOSSIL_ENABLE_JSON
523522
#if defined(NDEBUG)
@@ -536,13 +535,11 @@
536535
#ifdef FOSSIL_ENABLE_TCL
537536
memset(&g.tcl, 0, sizeof(TclContext));
538537
g.tcl.argc = g.argc;
539538
g.tcl.argv = copy_args(g.argc, g.argv); /* save full arguments */
540539
#endif
541
-
542540
g.mainTimerId = fossil_timer_start();
543
-
544541
if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
545542
zCmdName = "cgi";
546543
g.isHTTP = 1;
547544
}else if( g.argc<2 ){
548545
fossil_print(
549546
--- src/main.c
+++ src/main.c
@@ -513,11 +513,10 @@
513 #endif
514 {
515 const char *zCmdName = "unknown";
516 int idx;
517 int rc;
518 int timerId;
519 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
520 memset(&g, 0, sizeof(g));
521 g.now = time(0);
522 #ifdef FOSSIL_ENABLE_JSON
523 #if defined(NDEBUG)
@@ -536,13 +535,11 @@
536 #ifdef FOSSIL_ENABLE_TCL
537 memset(&g.tcl, 0, sizeof(TclContext));
538 g.tcl.argc = g.argc;
539 g.tcl.argv = copy_args(g.argc, g.argv); /* save full arguments */
540 #endif
541
542 g.mainTimerId = fossil_timer_start();
543
544 if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
545 zCmdName = "cgi";
546 g.isHTTP = 1;
547 }else if( g.argc<2 ){
548 fossil_print(
549
--- src/main.c
+++ src/main.c
@@ -513,11 +513,10 @@
513 #endif
514 {
515 const char *zCmdName = "unknown";
516 int idx;
517 int rc;
 
518 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
519 memset(&g, 0, sizeof(g));
520 g.now = time(0);
521 #ifdef FOSSIL_ENABLE_JSON
522 #if defined(NDEBUG)
@@ -536,13 +535,11 @@
535 #ifdef FOSSIL_ENABLE_TCL
536 memset(&g.tcl, 0, sizeof(TclContext));
537 g.tcl.argc = g.argc;
538 g.tcl.argv = copy_args(g.argc, g.argv); /* save full arguments */
539 #endif
 
540 g.mainTimerId = fossil_timer_start();
 
541 if( fossil_getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){
542 zCmdName = "cgi";
543 g.isHTTP = 1;
544 }else if( g.argc<2 ){
545 fossil_print(
546

Keyboard Shortcuts

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