Fossil SCM

adapt comments accordingly

jan.nijtmans 2012-10-31 20:56 UTC improve_looks_like_binary
Commit b5123d51542a179578eeb754797a7223c062e342
2 files changed +2 -4 +66 -66
+2 -4
--- src/diff.c
+++ src/diff.c
@@ -179,12 +179,11 @@
179179
** (1) -- The content appears to consist entirely of text, with lines
180180
** delimited by line-feed characters; however, the encoding may
181181
** not be UTF-8.
182182
**
183183
** (0) -- The content appears to be binary because it contains embedded
184
-** non-text characters - \0x0-\0x8, \0xe-\0x19, \0x1c-\0x1f, \uffff,
185
-** or \ufffe,\ufeff (except as BOM) - or an extremely long line.
184
+** NUL (\000) characters or an extremely long line.
186185
**
187186
** (-1) -- The content appears to consist entirely of text, with lines
188187
** delimited by carriage-return, line-feed pairs; however, the
189188
** encoding may not be UTF-8.
190189
**
@@ -196,12 +195,11 @@
196195
unsigned int n = blob_size(pContent);
197196
int j;
198197
unsigned char c;
199198
int result = 1; /* Assume text with no CR/NL */
200199
201
- /*
202
- ** Check individual lines.
200
+ /* Check individual lines.
203201
*/
204202
if( n==0 ) return result; /* Empty file -> text */
205203
c = *z;
206204
if( c==0 ) return 0; /* \000 byte in a file -> binary */
207205
if ( (n&1)==0 ){ /* UTF-16 must have an even blob length */
208206
--- src/diff.c
+++ src/diff.c
@@ -179,12 +179,11 @@
179 ** (1) -- The content appears to consist entirely of text, with lines
180 ** delimited by line-feed characters; however, the encoding may
181 ** not be UTF-8.
182 **
183 ** (0) -- The content appears to be binary because it contains embedded
184 ** non-text characters - \0x0-\0x8, \0xe-\0x19, \0x1c-\0x1f, \uffff,
185 ** or \ufffe,\ufeff (except as BOM) - or an extremely long line.
186 **
187 ** (-1) -- The content appears to consist entirely of text, with lines
188 ** delimited by carriage-return, line-feed pairs; however, the
189 ** encoding may not be UTF-8.
190 **
@@ -196,12 +195,11 @@
196 unsigned int n = blob_size(pContent);
197 int j;
198 unsigned char c;
199 int result = 1; /* Assume text with no CR/NL */
200
201 /*
202 ** Check individual lines.
203 */
204 if( n==0 ) return result; /* Empty file -> text */
205 c = *z;
206 if( c==0 ) return 0; /* \000 byte in a file -> binary */
207 if ( (n&1)==0 ){ /* UTF-16 must have an even blob length */
208
--- src/diff.c
+++ src/diff.c
@@ -179,12 +179,11 @@
179 ** (1) -- The content appears to consist entirely of text, with lines
180 ** delimited by line-feed characters; however, the encoding may
181 ** not be UTF-8.
182 **
183 ** (0) -- The content appears to be binary because it contains embedded
184 ** NUL (\000) characters or an extremely long line.
 
185 **
186 ** (-1) -- The content appears to consist entirely of text, with lines
187 ** delimited by carriage-return, line-feed pairs; however, the
188 ** encoding may not be UTF-8.
189 **
@@ -196,12 +195,11 @@
195 unsigned int n = blob_size(pContent);
196 int j;
197 unsigned char c;
198 int result = 1; /* Assume text with no CR/NL */
199
200 /* Check individual lines.
 
201 */
202 if( n==0 ) return result; /* Empty file -> text */
203 c = *z;
204 if( c==0 ) return 0; /* \000 byte in a file -> binary */
205 if ( (n&1)==0 ){ /* UTF-16 must have an even blob length */
206
+66 -66
--- src/doc.c
+++ src/doc.c
@@ -26,11 +26,11 @@
2626
** Try to guess the mimetype from content.
2727
**
2828
** If the content is pure text, return NULL.
2929
**
3030
** For image types, attempt to return an appropriate mimetype
31
-** name like "image/gif" or "image/jpeg".
31
+** name like "image/gif" or "image/jpeg".
3232
**
3333
** For any other binary type, return "unknown/unknown".
3434
*/
3535
const char *mimetype_from_content(Blob *pBlob){
3636
int i;
@@ -83,11 +83,11 @@
8383
int i;
8484
int first, last;
8585
int len;
8686
char zSuffix[20];
8787
88
- /* A table of mimetypes based on file suffixes.
88
+ /* A table of mimetypes based on file suffixes.
8989
** Suffixes must be in sorted order so that we can do a binary
9090
** search to find the mime-type
9191
*/
9292
static const struct {
9393
const char *zSuffix; /* The file suffix */
@@ -474,11 +474,11 @@
474474
}
475475
db_end_transaction(0);
476476
}
477477
478478
/* The file is now contained in the filebody blob. Deliver the
479
- ** file to the user
479
+ ** file to the user
480480
*/
481481
zMime = P("mimetype");
482482
if( zMime==0 ){
483483
zMime = mimetype_from_name(zName);
484484
}
@@ -513,79 +513,79 @@
513513
/* Jump here when unable to locate the document */
514514
db_end_transaction(0);
515515
style_header("Document Not Found");
516516
@ <p>No such document: %h(zName)</p>
517517
style_footer();
518
- return;
518
+ return;
519519
}
520520
521521
/*
522522
** The default logo.
523523
*/
524524
static const unsigned char aLogo[] = {
525
- 71, 73, 70, 56, 55, 97, 62, 0, 71, 0, 244, 0, 0, 85,
526
- 129, 149, 95, 136, 155, 99, 139, 157, 106, 144, 162, 113, 150, 166,
527
- 116, 152, 168, 127, 160, 175, 138, 168, 182, 148, 176, 188, 159, 184,
528
- 195, 170, 192, 202, 180, 199, 208, 184, 202, 210, 191, 207, 215, 201,
529
- 215, 221, 212, 223, 228, 223, 231, 235, 226, 227, 226, 226, 234, 237,
530
- 233, 239, 241, 240, 244, 246, 244, 247, 248, 255, 255, 255, 0, 0,
531
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
532
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0,
533
- 0, 0, 62, 0, 71, 0, 0, 5, 255, 96, 100, 141, 100, 105,
534
- 158, 168, 37, 41, 132, 192, 164, 112, 44, 207, 102, 99, 0, 56,
535
- 16, 84, 116, 239, 199, 141, 65, 110, 232, 248, 25, 141, 193, 161,
536
- 82, 113, 108, 202, 32, 55, 229, 210, 73, 61, 41, 164, 88, 102,
537
- 181, 10, 41, 96, 179, 91, 106, 35, 240, 5, 135, 143, 137, 242,
538
- 87, 123, 246, 33, 190, 81, 108, 163, 237, 198, 14, 30, 113, 233,
539
- 131, 78, 115, 72, 11, 115, 87, 101, 19, 124, 51, 66, 74, 8,
540
- 19, 16, 67, 100, 74, 133, 50, 15, 101, 135, 56, 11, 74, 6,
541
- 143, 49, 126, 106, 56, 8, 145, 67, 9, 152, 48, 139, 155, 5,
542
- 22, 13, 74, 115, 161, 41, 147, 101, 13, 130, 57, 132, 170, 40,
543
- 167, 155, 0, 94, 57, 3, 178, 48, 183, 181, 57, 160, 186, 40,
544
- 19, 141, 189, 0, 69, 192, 40, 16, 195, 155, 185, 199, 41, 201,
545
- 189, 191, 205, 193, 188, 131, 210, 49, 175, 88, 209, 214, 38, 19,
546
- 3, 11, 19, 111, 127, 60, 219, 39, 55, 204, 19, 11, 6, 100,
547
- 5, 10, 227, 228, 37, 163, 0, 239, 117, 56, 238, 243, 49, 195,
548
- 177, 247, 48, 158, 56, 251, 50, 216, 254, 197, 56, 128, 107, 158,
549
- 2, 125, 171, 114, 92, 218, 246, 96, 66, 3, 4, 50, 134, 176,
550
- 145, 6, 97, 64, 144, 24, 19, 136, 108, 91, 177, 160, 0, 194,
551
- 19, 253, 0, 216, 107, 214, 224, 192, 129, 5, 16, 83, 255, 244,
552
- 43, 213, 195, 24, 159, 27, 169, 64, 230, 88, 208, 227, 129, 182,
553
- 54, 4, 89, 158, 24, 181, 163, 199, 1, 155, 52, 233, 8, 130,
554
- 176, 83, 24, 128, 137, 50, 18, 32, 48, 48, 114, 11, 173, 137,
555
- 19, 110, 4, 64, 105, 1, 194, 30, 140, 68, 15, 24, 24, 224,
556
- 50, 76, 70, 0, 11, 171, 54, 26, 160, 181, 194, 149, 148, 40,
557
- 174, 148, 122, 64, 180, 208, 161, 17, 207, 112, 164, 1, 128, 96,
558
- 148, 78, 18, 21, 194, 33, 229, 51, 247, 65, 133, 97, 5, 250,
559
- 69, 229, 100, 34, 220, 128, 166, 116, 190, 62, 8, 167, 195, 170,
560
- 47, 163, 0, 130, 90, 152, 11, 160, 173, 170, 27, 154, 26, 91,
561
- 232, 151, 171, 18, 14, 162, 253, 98, 170, 18, 70, 171, 64, 219,
562
- 10, 67, 136, 134, 187, 116, 75, 180, 46, 179, 174, 135, 4, 189,
563
- 229, 231, 78, 40, 10, 62, 226, 164, 172, 64, 240, 167, 170, 10,
564
- 18, 124, 188, 10, 107, 65, 193, 94, 11, 93, 171, 28, 248, 17,
565
- 239, 46, 140, 78, 97, 34, 25, 153, 36, 99, 65, 130, 7, 203,
566
- 183, 168, 51, 34, 136, 25, 140, 10, 6, 16, 28, 255, 145, 241,
567
- 230, 140, 10, 66, 178, 167, 112, 48, 192, 128, 129, 9, 31, 141,
568
- 84, 138, 63, 163, 162, 2, 203, 206, 240, 56, 55, 98, 192, 188,
569
- 15, 185, 50, 160, 6, 0, 125, 62, 33, 214, 195, 33, 5, 24,
570
- 184, 25, 231, 14, 201, 245, 144, 23, 126, 104, 228, 0, 145, 2,
571
- 13, 140, 244, 212, 17, 21, 20, 176, 159, 17, 95, 225, 160, 128,
572
- 16, 1, 32, 224, 142, 32, 227, 125, 87, 64, 0, 16, 54, 129,
573
- 205, 2, 141, 76, 53, 130, 103, 37, 166, 64, 144, 107, 78, 196,
574
- 5, 192, 0, 54, 50, 229, 9, 141, 49, 84, 194, 35, 12, 196,
575
- 153, 48, 192, 137, 57, 84, 24, 7, 87, 159, 249, 240, 215, 143,
576
- 105, 241, 118, 149, 9, 139, 4, 64, 203, 141, 35, 140, 129, 131,
577
- 16, 222, 125, 231, 128, 2, 238, 17, 152, 66, 3, 5, 56, 224,
578
- 159, 103, 16, 76, 25, 75, 5, 11, 164, 215, 96, 9, 14, 16,
579
- 36, 225, 15, 11, 40, 144, 192, 156, 41, 10, 178, 199, 3, 66,
580
- 64, 80, 193, 3, 124, 90, 48, 129, 129, 102, 177, 18, 192, 154,
581
- 49, 84, 240, 208, 92, 22, 149, 96, 39, 9, 31, 74, 17, 94,
582
- 3, 8, 177, 199, 72, 59, 85, 76, 25, 216, 8, 139, 194, 197,
583
- 138, 163, 69, 96, 115, 0, 147, 72, 72, 84, 28, 14, 79, 86,
584
- 233, 230, 23, 113, 26, 160, 128, 3, 10, 58, 129, 103, 14, 159,
585
- 214, 163, 146, 117, 238, 213, 154, 128, 151, 109, 84, 64, 217, 13,
586
- 27, 10, 228, 39, 2, 235, 164, 168, 74, 8, 0, 59,
525
+ 71, 73, 70, 56, 55, 97, 62, 0, 71, 0, 244, 0, 0, 85,
526
+ 129, 149, 95, 136, 155, 99, 139, 157, 106, 144, 162, 113, 150, 166,
527
+ 116, 152, 168, 127, 160, 175, 138, 168, 182, 148, 176, 188, 159, 184,
528
+ 195, 170, 192, 202, 180, 199, 208, 184, 202, 210, 191, 207, 215, 201,
529
+ 215, 221, 212, 223, 228, 223, 231, 235, 226, 227, 226, 226, 234, 237,
530
+ 233, 239, 241, 240, 244, 246, 244, 247, 248, 255, 255, 255, 0, 0,
531
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
532
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0,
533
+ 0, 0, 62, 0, 71, 0, 0, 5, 255, 96, 100, 141, 100, 105,
534
+ 158, 168, 37, 41, 132, 192, 164, 112, 44, 207, 102, 99, 0, 56,
535
+ 16, 84, 116, 239, 199, 141, 65, 110, 232, 248, 25, 141, 193, 161,
536
+ 82, 113, 108, 202, 32, 55, 229, 210, 73, 61, 41, 164, 88, 102,
537
+ 181, 10, 41, 96, 179, 91, 106, 35, 240, 5, 135, 143, 137, 242,
538
+ 87, 123, 246, 33, 190, 81, 108, 163, 237, 198, 14, 30, 113, 233,
539
+ 131, 78, 115, 72, 11, 115, 87, 101, 19, 124, 51, 66, 74, 8,
540
+ 19, 16, 67, 100, 74, 133, 50, 15, 101, 135, 56, 11, 74, 6,
541
+ 143, 49, 126, 106, 56, 8, 145, 67, 9, 152, 48, 139, 155, 5,
542
+ 22, 13, 74, 115, 161, 41, 147, 101, 13, 130, 57, 132, 170, 40,
543
+ 167, 155, 0, 94, 57, 3, 178, 48, 183, 181, 57, 160, 186, 40,
544
+ 19, 141, 189, 0, 69, 192, 40, 16, 195, 155, 185, 199, 41, 201,
545
+ 189, 191, 205, 193, 188, 131, 210, 49, 175, 88, 209, 214, 38, 19,
546
+ 3, 11, 19, 111, 127, 60, 219, 39, 55, 204, 19, 11, 6, 100,
547
+ 5, 10, 227, 228, 37, 163, 0, 239, 117, 56, 238, 243, 49, 195,
548
+ 177, 247, 48, 158, 56, 251, 50, 216, 254, 197, 56, 128, 107, 158,
549
+ 2, 125, 171, 114, 92, 218, 246, 96, 66, 3, 4, 50, 134, 176,
550
+ 145, 6, 97, 64, 144, 24, 19, 136, 108, 91, 177, 160, 0, 194,
551
+ 19, 253, 0, 216, 107, 214, 224, 192, 129, 5, 16, 83, 255, 244,
552
+ 43, 213, 195, 24, 159, 27, 169, 64, 230, 88, 208, 227, 129, 182,
553
+ 54, 4, 89, 158, 24, 181, 163, 199, 1, 155, 52, 233, 8, 130,
554
+ 176, 83, 24, 128, 137, 50, 18, 32, 48, 48, 114, 11, 173, 137,
555
+ 19, 110, 4, 64, 105, 1, 194, 30, 140, 68, 15, 24, 24, 224,
556
+ 50, 76, 70, 0, 11, 171, 54, 26, 160, 181, 194, 149, 148, 40,
557
+ 174, 148, 122, 64, 180, 208, 161, 17, 207, 112, 164, 1, 128, 96,
558
+ 148, 78, 18, 21, 194, 33, 229, 51, 247, 65, 133, 97, 5, 250,
559
+ 69, 229, 100, 34, 220, 128, 166, 116, 190, 62, 8, 167, 195, 170,
560
+ 47, 163, 0, 130, 90, 152, 11, 160, 173, 170, 27, 154, 26, 91,
561
+ 232, 151, 171, 18, 14, 162, 253, 98, 170, 18, 70, 171, 64, 219,
562
+ 10, 67, 136, 134, 187, 116, 75, 180, 46, 179, 174, 135, 4, 189,
563
+ 229, 231, 78, 40, 10, 62, 226, 164, 172, 64, 240, 167, 170, 10,
564
+ 18, 124, 188, 10, 107, 65, 193, 94, 11, 93, 171, 28, 248, 17,
565
+ 239, 46, 140, 78, 97, 34, 25, 153, 36, 99, 65, 130, 7, 203,
566
+ 183, 168, 51, 34, 136, 25, 140, 10, 6, 16, 28, 255, 145, 241,
567
+ 230, 140, 10, 66, 178, 167, 112, 48, 192, 128, 129, 9, 31, 141,
568
+ 84, 138, 63, 163, 162, 2, 203, 206, 240, 56, 55, 98, 192, 188,
569
+ 15, 185, 50, 160, 6, 0, 125, 62, 33, 214, 195, 33, 5, 24,
570
+ 184, 25, 231, 14, 201, 245, 144, 23, 126, 104, 228, 0, 145, 2,
571
+ 13, 140, 244, 212, 17, 21, 20, 176, 159, 17, 95, 225, 160, 128,
572
+ 16, 1, 32, 224, 142, 32, 227, 125, 87, 64, 0, 16, 54, 129,
573
+ 205, 2, 141, 76, 53, 130, 103, 37, 166, 64, 144, 107, 78, 196,
574
+ 5, 192, 0, 54, 50, 229, 9, 141, 49, 84, 194, 35, 12, 196,
575
+ 153, 48, 192, 137, 57, 84, 24, 7, 87, 159, 249, 240, 215, 143,
576
+ 105, 241, 118, 149, 9, 139, 4, 64, 203, 141, 35, 140, 129, 131,
577
+ 16, 222, 125, 231, 128, 2, 238, 17, 152, 66, 3, 5, 56, 224,
578
+ 159, 103, 16, 76, 25, 75, 5, 11, 164, 215, 96, 9, 14, 16,
579
+ 36, 225, 15, 11, 40, 144, 192, 156, 41, 10, 178, 199, 3, 66,
580
+ 64, 80, 193, 3, 124, 90, 48, 129, 129, 102, 177, 18, 192, 154,
581
+ 49, 84, 240, 208, 92, 22, 149, 96, 39, 9, 31, 74, 17, 94,
582
+ 3, 8, 177, 199, 72, 59, 85, 76, 25, 216, 8, 139, 194, 197,
583
+ 138, 163, 69, 96, 115, 0, 147, 72, 72, 84, 28, 14, 79, 86,
584
+ 233, 230, 23, 113, 26, 160, 128, 3, 10, 58, 129, 103, 14, 159,
585
+ 214, 163, 146, 117, 238, 213, 154, 128, 151, 109, 84, 64, 217, 13,
586
+ 27, 10, 228, 39, 2, 235, 164, 168, 74, 8, 0, 59,
587587
};
588588
589589
/*
590590
** WEBPAGE: logo
591591
**
592592
--- src/doc.c
+++ src/doc.c
@@ -26,11 +26,11 @@
26 ** Try to guess the mimetype from content.
27 **
28 ** If the content is pure text, return NULL.
29 **
30 ** For image types, attempt to return an appropriate mimetype
31 ** name like "image/gif" or "image/jpeg".
32 **
33 ** For any other binary type, return "unknown/unknown".
34 */
35 const char *mimetype_from_content(Blob *pBlob){
36 int i;
@@ -83,11 +83,11 @@
83 int i;
84 int first, last;
85 int len;
86 char zSuffix[20];
87
88 /* A table of mimetypes based on file suffixes.
89 ** Suffixes must be in sorted order so that we can do a binary
90 ** search to find the mime-type
91 */
92 static const struct {
93 const char *zSuffix; /* The file suffix */
@@ -474,11 +474,11 @@
474 }
475 db_end_transaction(0);
476 }
477
478 /* The file is now contained in the filebody blob. Deliver the
479 ** file to the user
480 */
481 zMime = P("mimetype");
482 if( zMime==0 ){
483 zMime = mimetype_from_name(zName);
484 }
@@ -513,79 +513,79 @@
513 /* Jump here when unable to locate the document */
514 db_end_transaction(0);
515 style_header("Document Not Found");
516 @ <p>No such document: %h(zName)</p>
517 style_footer();
518 return;
519 }
520
521 /*
522 ** The default logo.
523 */
524 static const unsigned char aLogo[] = {
525 71, 73, 70, 56, 55, 97, 62, 0, 71, 0, 244, 0, 0, 85,
526 129, 149, 95, 136, 155, 99, 139, 157, 106, 144, 162, 113, 150, 166,
527 116, 152, 168, 127, 160, 175, 138, 168, 182, 148, 176, 188, 159, 184,
528 195, 170, 192, 202, 180, 199, 208, 184, 202, 210, 191, 207, 215, 201,
529 215, 221, 212, 223, 228, 223, 231, 235, 226, 227, 226, 226, 234, 237,
530 233, 239, 241, 240, 244, 246, 244, 247, 248, 255, 255, 255, 0, 0,
531 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
532 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0,
533 0, 0, 62, 0, 71, 0, 0, 5, 255, 96, 100, 141, 100, 105,
534 158, 168, 37, 41, 132, 192, 164, 112, 44, 207, 102, 99, 0, 56,
535 16, 84, 116, 239, 199, 141, 65, 110, 232, 248, 25, 141, 193, 161,
536 82, 113, 108, 202, 32, 55, 229, 210, 73, 61, 41, 164, 88, 102,
537 181, 10, 41, 96, 179, 91, 106, 35, 240, 5, 135, 143, 137, 242,
538 87, 123, 246, 33, 190, 81, 108, 163, 237, 198, 14, 30, 113, 233,
539 131, 78, 115, 72, 11, 115, 87, 101, 19, 124, 51, 66, 74, 8,
540 19, 16, 67, 100, 74, 133, 50, 15, 101, 135, 56, 11, 74, 6,
541 143, 49, 126, 106, 56, 8, 145, 67, 9, 152, 48, 139, 155, 5,
542 22, 13, 74, 115, 161, 41, 147, 101, 13, 130, 57, 132, 170, 40,
543 167, 155, 0, 94, 57, 3, 178, 48, 183, 181, 57, 160, 186, 40,
544 19, 141, 189, 0, 69, 192, 40, 16, 195, 155, 185, 199, 41, 201,
545 189, 191, 205, 193, 188, 131, 210, 49, 175, 88, 209, 214, 38, 19,
546 3, 11, 19, 111, 127, 60, 219, 39, 55, 204, 19, 11, 6, 100,
547 5, 10, 227, 228, 37, 163, 0, 239, 117, 56, 238, 243, 49, 195,
548 177, 247, 48, 158, 56, 251, 50, 216, 254, 197, 56, 128, 107, 158,
549 2, 125, 171, 114, 92, 218, 246, 96, 66, 3, 4, 50, 134, 176,
550 145, 6, 97, 64, 144, 24, 19, 136, 108, 91, 177, 160, 0, 194,
551 19, 253, 0, 216, 107, 214, 224, 192, 129, 5, 16, 83, 255, 244,
552 43, 213, 195, 24, 159, 27, 169, 64, 230, 88, 208, 227, 129, 182,
553 54, 4, 89, 158, 24, 181, 163, 199, 1, 155, 52, 233, 8, 130,
554 176, 83, 24, 128, 137, 50, 18, 32, 48, 48, 114, 11, 173, 137,
555 19, 110, 4, 64, 105, 1, 194, 30, 140, 68, 15, 24, 24, 224,
556 50, 76, 70, 0, 11, 171, 54, 26, 160, 181, 194, 149, 148, 40,
557 174, 148, 122, 64, 180, 208, 161, 17, 207, 112, 164, 1, 128, 96,
558 148, 78, 18, 21, 194, 33, 229, 51, 247, 65, 133, 97, 5, 250,
559 69, 229, 100, 34, 220, 128, 166, 116, 190, 62, 8, 167, 195, 170,
560 47, 163, 0, 130, 90, 152, 11, 160, 173, 170, 27, 154, 26, 91,
561 232, 151, 171, 18, 14, 162, 253, 98, 170, 18, 70, 171, 64, 219,
562 10, 67, 136, 134, 187, 116, 75, 180, 46, 179, 174, 135, 4, 189,
563 229, 231, 78, 40, 10, 62, 226, 164, 172, 64, 240, 167, 170, 10,
564 18, 124, 188, 10, 107, 65, 193, 94, 11, 93, 171, 28, 248, 17,
565 239, 46, 140, 78, 97, 34, 25, 153, 36, 99, 65, 130, 7, 203,
566 183, 168, 51, 34, 136, 25, 140, 10, 6, 16, 28, 255, 145, 241,
567 230, 140, 10, 66, 178, 167, 112, 48, 192, 128, 129, 9, 31, 141,
568 84, 138, 63, 163, 162, 2, 203, 206, 240, 56, 55, 98, 192, 188,
569 15, 185, 50, 160, 6, 0, 125, 62, 33, 214, 195, 33, 5, 24,
570 184, 25, 231, 14, 201, 245, 144, 23, 126, 104, 228, 0, 145, 2,
571 13, 140, 244, 212, 17, 21, 20, 176, 159, 17, 95, 225, 160, 128,
572 16, 1, 32, 224, 142, 32, 227, 125, 87, 64, 0, 16, 54, 129,
573 205, 2, 141, 76, 53, 130, 103, 37, 166, 64, 144, 107, 78, 196,
574 5, 192, 0, 54, 50, 229, 9, 141, 49, 84, 194, 35, 12, 196,
575 153, 48, 192, 137, 57, 84, 24, 7, 87, 159, 249, 240, 215, 143,
576 105, 241, 118, 149, 9, 139, 4, 64, 203, 141, 35, 140, 129, 131,
577 16, 222, 125, 231, 128, 2, 238, 17, 152, 66, 3, 5, 56, 224,
578 159, 103, 16, 76, 25, 75, 5, 11, 164, 215, 96, 9, 14, 16,
579 36, 225, 15, 11, 40, 144, 192, 156, 41, 10, 178, 199, 3, 66,
580 64, 80, 193, 3, 124, 90, 48, 129, 129, 102, 177, 18, 192, 154,
581 49, 84, 240, 208, 92, 22, 149, 96, 39, 9, 31, 74, 17, 94,
582 3, 8, 177, 199, 72, 59, 85, 76, 25, 216, 8, 139, 194, 197,
583 138, 163, 69, 96, 115, 0, 147, 72, 72, 84, 28, 14, 79, 86,
584 233, 230, 23, 113, 26, 160, 128, 3, 10, 58, 129, 103, 14, 159,
585 214, 163, 146, 117, 238, 213, 154, 128, 151, 109, 84, 64, 217, 13,
586 27, 10, 228, 39, 2, 235, 164, 168, 74, 8, 0, 59,
587 };
588
589 /*
590 ** WEBPAGE: logo
591 **
592
--- src/doc.c
+++ src/doc.c
@@ -26,11 +26,11 @@
26 ** Try to guess the mimetype from content.
27 **
28 ** If the content is pure text, return NULL.
29 **
30 ** For image types, attempt to return an appropriate mimetype
31 ** name like "image/gif" or "image/jpeg".
32 **
33 ** For any other binary type, return "unknown/unknown".
34 */
35 const char *mimetype_from_content(Blob *pBlob){
36 int i;
@@ -83,11 +83,11 @@
83 int i;
84 int first, last;
85 int len;
86 char zSuffix[20];
87
88 /* A table of mimetypes based on file suffixes.
89 ** Suffixes must be in sorted order so that we can do a binary
90 ** search to find the mime-type
91 */
92 static const struct {
93 const char *zSuffix; /* The file suffix */
@@ -474,11 +474,11 @@
474 }
475 db_end_transaction(0);
476 }
477
478 /* The file is now contained in the filebody blob. Deliver the
479 ** file to the user
480 */
481 zMime = P("mimetype");
482 if( zMime==0 ){
483 zMime = mimetype_from_name(zName);
484 }
@@ -513,79 +513,79 @@
513 /* Jump here when unable to locate the document */
514 db_end_transaction(0);
515 style_header("Document Not Found");
516 @ <p>No such document: %h(zName)</p>
517 style_footer();
518 return;
519 }
520
521 /*
522 ** The default logo.
523 */
524 static const unsigned char aLogo[] = {
525 71, 73, 70, 56, 55, 97, 62, 0, 71, 0, 244, 0, 0, 85,
526 129, 149, 95, 136, 155, 99, 139, 157, 106, 144, 162, 113, 150, 166,
527 116, 152, 168, 127, 160, 175, 138, 168, 182, 148, 176, 188, 159, 184,
528 195, 170, 192, 202, 180, 199, 208, 184, 202, 210, 191, 207, 215, 201,
529 215, 221, 212, 223, 228, 223, 231, 235, 226, 227, 226, 226, 234, 237,
530 233, 239, 241, 240, 244, 246, 244, 247, 248, 255, 255, 255, 0, 0,
531 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
532 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0,
533 0, 0, 62, 0, 71, 0, 0, 5, 255, 96, 100, 141, 100, 105,
534 158, 168, 37, 41, 132, 192, 164, 112, 44, 207, 102, 99, 0, 56,
535 16, 84, 116, 239, 199, 141, 65, 110, 232, 248, 25, 141, 193, 161,
536 82, 113, 108, 202, 32, 55, 229, 210, 73, 61, 41, 164, 88, 102,
537 181, 10, 41, 96, 179, 91, 106, 35, 240, 5, 135, 143, 137, 242,
538 87, 123, 246, 33, 190, 81, 108, 163, 237, 198, 14, 30, 113, 233,
539 131, 78, 115, 72, 11, 115, 87, 101, 19, 124, 51, 66, 74, 8,
540 19, 16, 67, 100, 74, 133, 50, 15, 101, 135, 56, 11, 74, 6,
541 143, 49, 126, 106, 56, 8, 145, 67, 9, 152, 48, 139, 155, 5,
542 22, 13, 74, 115, 161, 41, 147, 101, 13, 130, 57, 132, 170, 40,
543 167, 155, 0, 94, 57, 3, 178, 48, 183, 181, 57, 160, 186, 40,
544 19, 141, 189, 0, 69, 192, 40, 16, 195, 155, 185, 199, 41, 201,
545 189, 191, 205, 193, 188, 131, 210, 49, 175, 88, 209, 214, 38, 19,
546 3, 11, 19, 111, 127, 60, 219, 39, 55, 204, 19, 11, 6, 100,
547 5, 10, 227, 228, 37, 163, 0, 239, 117, 56, 238, 243, 49, 195,
548 177, 247, 48, 158, 56, 251, 50, 216, 254, 197, 56, 128, 107, 158,
549 2, 125, 171, 114, 92, 218, 246, 96, 66, 3, 4, 50, 134, 176,
550 145, 6, 97, 64, 144, 24, 19, 136, 108, 91, 177, 160, 0, 194,
551 19, 253, 0, 216, 107, 214, 224, 192, 129, 5, 16, 83, 255, 244,
552 43, 213, 195, 24, 159, 27, 169, 64, 230, 88, 208, 227, 129, 182,
553 54, 4, 89, 158, 24, 181, 163, 199, 1, 155, 52, 233, 8, 130,
554 176, 83, 24, 128, 137, 50, 18, 32, 48, 48, 114, 11, 173, 137,
555 19, 110, 4, 64, 105, 1, 194, 30, 140, 68, 15, 24, 24, 224,
556 50, 76, 70, 0, 11, 171, 54, 26, 160, 181, 194, 149, 148, 40,
557 174, 148, 122, 64, 180, 208, 161, 17, 207, 112, 164, 1, 128, 96,
558 148, 78, 18, 21, 194, 33, 229, 51, 247, 65, 133, 97, 5, 250,
559 69, 229, 100, 34, 220, 128, 166, 116, 190, 62, 8, 167, 195, 170,
560 47, 163, 0, 130, 90, 152, 11, 160, 173, 170, 27, 154, 26, 91,
561 232, 151, 171, 18, 14, 162, 253, 98, 170, 18, 70, 171, 64, 219,
562 10, 67, 136, 134, 187, 116, 75, 180, 46, 179, 174, 135, 4, 189,
563 229, 231, 78, 40, 10, 62, 226, 164, 172, 64, 240, 167, 170, 10,
564 18, 124, 188, 10, 107, 65, 193, 94, 11, 93, 171, 28, 248, 17,
565 239, 46, 140, 78, 97, 34, 25, 153, 36, 99, 65, 130, 7, 203,
566 183, 168, 51, 34, 136, 25, 140, 10, 6, 16, 28, 255, 145, 241,
567 230, 140, 10, 66, 178, 167, 112, 48, 192, 128, 129, 9, 31, 141,
568 84, 138, 63, 163, 162, 2, 203, 206, 240, 56, 55, 98, 192, 188,
569 15, 185, 50, 160, 6, 0, 125, 62, 33, 214, 195, 33, 5, 24,
570 184, 25, 231, 14, 201, 245, 144, 23, 126, 104, 228, 0, 145, 2,
571 13, 140, 244, 212, 17, 21, 20, 176, 159, 17, 95, 225, 160, 128,
572 16, 1, 32, 224, 142, 32, 227, 125, 87, 64, 0, 16, 54, 129,
573 205, 2, 141, 76, 53, 130, 103, 37, 166, 64, 144, 107, 78, 196,
574 5, 192, 0, 54, 50, 229, 9, 141, 49, 84, 194, 35, 12, 196,
575 153, 48, 192, 137, 57, 84, 24, 7, 87, 159, 249, 240, 215, 143,
576 105, 241, 118, 149, 9, 139, 4, 64, 203, 141, 35, 140, 129, 131,
577 16, 222, 125, 231, 128, 2, 238, 17, 152, 66, 3, 5, 56, 224,
578 159, 103, 16, 76, 25, 75, 5, 11, 164, 215, 96, 9, 14, 16,
579 36, 225, 15, 11, 40, 144, 192, 156, 41, 10, 178, 199, 3, 66,
580 64, 80, 193, 3, 124, 90, 48, 129, 129, 102, 177, 18, 192, 154,
581 49, 84, 240, 208, 92, 22, 149, 96, 39, 9, 31, 74, 17, 94,
582 3, 8, 177, 199, 72, 59, 85, 76, 25, 216, 8, 139, 194, 197,
583 138, 163, 69, 96, 115, 0, 147, 72, 72, 84, 28, 14, 79, 86,
584 233, 230, 23, 113, 26, 160, 128, 3, 10, 58, 129, 103, 14, 159,
585 214, 163, 146, 117, 238, 213, 154, 128, 151, 109, 84, 64, 217, 13,
586 27, 10, 228, 39, 2, 235, 164, 168, 74, 8, 0, 59,
587 };
588
589 /*
590 ** WEBPAGE: logo
591 **
592

Keyboard Shortcuts

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