Fossil SCM

Code cleanup: Add a lot of "const" qualifiers for static (string) arrays, where appropriate. This allows the C compiler to optimize more

jan.nijtmans 2019-07-16 20:02 trunk
Commit 70a94d09720fc8a03aa7a02713c6804734c42f5dd21c25fc09c56a9d75f7a919
--- src/capabilities.c
+++ src/capabilities.c
@@ -91,11 +91,11 @@
9191
void capability_free(CapabilityString *p){
9292
fossil_free(p);
9393
}
9494
9595
/*
96
-** Expand the capability string by including all capabilities for
96
+** Expand the capability string by including all capabilities for
9797
** special users "nobody" and "anonymous". Also include "reader"
9898
** if "u" is present and "developer" if "v" is present.
9999
*/
100100
void capability_expand(CapabilityString *pIn){
101101
static char *zNobody = 0;
@@ -379,12 +379,12 @@
379379
while( db_step(&q)==SQLITE_ROW ){
380380
const char *zId = db_column_text(&q, 0);
381381
const char *zCap = db_column_text(&q, 1);
382382
int n = db_column_int(&q, 3);
383383
int eType;
384
- static const char *azType[] = { "off", "read", "write" };
385
- static const char *azClass[] = { "capsumOff", "capsumRead", "capsumWrite" };
384
+ static const char *const azType[] = { "off", "read", "write" };
385
+ static const char *const azClass[] = { "capsumOff", "capsumRead", "capsumWrite" };
386386
387387
if( n==0 ) continue;
388388
389389
/* Code */
390390
if( db_column_int(&q,2)<10 ){
391391
--- src/capabilities.c
+++ src/capabilities.c
@@ -91,11 +91,11 @@
91 void capability_free(CapabilityString *p){
92 fossil_free(p);
93 }
94
95 /*
96 ** Expand the capability string by including all capabilities for
97 ** special users "nobody" and "anonymous". Also include "reader"
98 ** if "u" is present and "developer" if "v" is present.
99 */
100 void capability_expand(CapabilityString *pIn){
101 static char *zNobody = 0;
@@ -379,12 +379,12 @@
379 while( db_step(&q)==SQLITE_ROW ){
380 const char *zId = db_column_text(&q, 0);
381 const char *zCap = db_column_text(&q, 1);
382 int n = db_column_int(&q, 3);
383 int eType;
384 static const char *azType[] = { "off", "read", "write" };
385 static const char *azClass[] = { "capsumOff", "capsumRead", "capsumWrite" };
386
387 if( n==0 ) continue;
388
389 /* Code */
390 if( db_column_int(&q,2)<10 ){
391
--- src/capabilities.c
+++ src/capabilities.c
@@ -91,11 +91,11 @@
91 void capability_free(CapabilityString *p){
92 fossil_free(p);
93 }
94
95 /*
96 ** Expand the capability string by including all capabilities for
97 ** special users "nobody" and "anonymous". Also include "reader"
98 ** if "u" is present and "developer" if "v" is present.
99 */
100 void capability_expand(CapabilityString *pIn){
101 static char *zNobody = 0;
@@ -379,12 +379,12 @@
379 while( db_step(&q)==SQLITE_ROW ){
380 const char *zId = db_column_text(&q, 0);
381 const char *zCap = db_column_text(&q, 1);
382 int n = db_column_int(&q, 3);
383 int eType;
384 static const char *const azType[] = { "off", "read", "write" };
385 static const char *const azClass[] = { "capsumOff", "capsumRead", "capsumWrite" };
386
387 if( n==0 ) continue;
388
389 /* Code */
390 if( db_column_int(&q,2)<10 ){
391
+3 -3
--- src/cgi.c
+++ src/cgi.c
@@ -162,12 +162,12 @@
162162
}
163163
164164
/*
165165
** Additional information used to form the HTTP reply
166166
*/
167
-static char *zContentType = "text/html"; /* Content type of the reply */
168
-static char *zReplyStatus = "OK"; /* Reply status description */
167
+static const char *zContentType = "text/html"; /* Content type of the reply */
168
+static const char *zReplyStatus = "OK"; /* Reply status description */
169169
static int iReplyStatus = 200; /* Reply status code */
170170
static Blob extraHeader = BLOB_INITIALIZER; /* Extra header text */
171171
172172
/*
173173
** Set the reply content type
@@ -1943,11 +1943,11 @@
19431943
fprintf(stderr, "/***** Child %d exited on signal %d (%s) *****/\n",
19441944
x, WTERMSIG(iStatus), strsignal(WTERMSIG(iStatus)));
19451945
}
19461946
nchildren--;
19471947
}
1948
- }
1948
+ }
19491949
}
19501950
/* NOT REACHED */
19511951
fossil_exit(1);
19521952
#endif
19531953
/* NOT REACHED */
19541954
--- src/cgi.c
+++ src/cgi.c
@@ -162,12 +162,12 @@
162 }
163
164 /*
165 ** Additional information used to form the HTTP reply
166 */
167 static char *zContentType = "text/html"; /* Content type of the reply */
168 static char *zReplyStatus = "OK"; /* Reply status description */
169 static int iReplyStatus = 200; /* Reply status code */
170 static Blob extraHeader = BLOB_INITIALIZER; /* Extra header text */
171
172 /*
173 ** Set the reply content type
@@ -1943,11 +1943,11 @@
1943 fprintf(stderr, "/***** Child %d exited on signal %d (%s) *****/\n",
1944 x, WTERMSIG(iStatus), strsignal(WTERMSIG(iStatus)));
1945 }
1946 nchildren--;
1947 }
1948 }
1949 }
1950 /* NOT REACHED */
1951 fossil_exit(1);
1952 #endif
1953 /* NOT REACHED */
1954
--- src/cgi.c
+++ src/cgi.c
@@ -162,12 +162,12 @@
162 }
163
164 /*
165 ** Additional information used to form the HTTP reply
166 */
167 static const char *zContentType = "text/html"; /* Content type of the reply */
168 static const char *zReplyStatus = "OK"; /* Reply status description */
169 static int iReplyStatus = 200; /* Reply status code */
170 static Blob extraHeader = BLOB_INITIALIZER; /* Extra header text */
171
172 /*
173 ** Set the reply content type
@@ -1943,11 +1943,11 @@
1943 fprintf(stderr, "/***** Child %d exited on signal %d (%s) *****/\n",
1944 x, WTERMSIG(iStatus), strsignal(WTERMSIG(iStatus)));
1945 }
1946 nchildren--;
1947 }
1948 }
1949 }
1950 /* NOT REACHED */
1951 fossil_exit(1);
1952 #endif
1953 /* NOT REACHED */
1954
+4 -4
--- src/deltafunc.c
+++ src/deltafunc.c
@@ -175,11 +175,11 @@
175175
int iNext; /* Next cursor value */
176176
};
177177
178178
/* Operator names:
179179
*/
180
-static const char *azOp[] = {
180
+static const char *const azOp[] = {
181181
"SIZE", "COPY", "INSERT", "CHECKSUM", "ERROR", "EOF"
182182
};
183183
#define DELTAPARSE_OP_SIZE 0
184184
#define DELTAPARSE_OP_COPY 1
185185
#define DELTAPARSE_OP_INSERT 2
@@ -389,15 +389,15 @@
389389
}
390390
391391
/*
392392
** This method is called to "rewind" the deltaparsevtab_cursor object back
393393
** to the first row of output. This method is always called at least
394
-** once prior to any call to deltaparsevtabColumn() or deltaparsevtabRowid() or
394
+** once prior to any call to deltaparsevtabColumn() or deltaparsevtabRowid() or
395395
** deltaparsevtabEof().
396396
*/
397397
static int deltaparsevtabFilter(
398
- sqlite3_vtab_cursor *pVtabCursor,
398
+ sqlite3_vtab_cursor *pVtabCursor,
399399
int idxNum, const char *idxStr,
400400
int argc, sqlite3_value **argv
401401
){
402402
deltaparsevtab_cursor *pCur = (deltaparsevtab_cursor *)pVtabCursor;
403403
const char *a;
@@ -459,11 +459,11 @@
459459
pIdxInfo->estimatedRows = 0x7fffffff;
460460
return SQLITE_CONSTRAINT;
461461
}
462462
463463
/*
464
-** This following structure defines all the methods for the
464
+** This following structure defines all the methods for the
465465
** virtual table.
466466
*/
467467
static sqlite3_module deltaparsevtabModule = {
468468
/* iVersion */ 0,
469469
/* xCreate */ 0,
470470
--- src/deltafunc.c
+++ src/deltafunc.c
@@ -175,11 +175,11 @@
175 int iNext; /* Next cursor value */
176 };
177
178 /* Operator names:
179 */
180 static const char *azOp[] = {
181 "SIZE", "COPY", "INSERT", "CHECKSUM", "ERROR", "EOF"
182 };
183 #define DELTAPARSE_OP_SIZE 0
184 #define DELTAPARSE_OP_COPY 1
185 #define DELTAPARSE_OP_INSERT 2
@@ -389,15 +389,15 @@
389 }
390
391 /*
392 ** This method is called to "rewind" the deltaparsevtab_cursor object back
393 ** to the first row of output. This method is always called at least
394 ** once prior to any call to deltaparsevtabColumn() or deltaparsevtabRowid() or
395 ** deltaparsevtabEof().
396 */
397 static int deltaparsevtabFilter(
398 sqlite3_vtab_cursor *pVtabCursor,
399 int idxNum, const char *idxStr,
400 int argc, sqlite3_value **argv
401 ){
402 deltaparsevtab_cursor *pCur = (deltaparsevtab_cursor *)pVtabCursor;
403 const char *a;
@@ -459,11 +459,11 @@
459 pIdxInfo->estimatedRows = 0x7fffffff;
460 return SQLITE_CONSTRAINT;
461 }
462
463 /*
464 ** This following structure defines all the methods for the
465 ** virtual table.
466 */
467 static sqlite3_module deltaparsevtabModule = {
468 /* iVersion */ 0,
469 /* xCreate */ 0,
470
--- src/deltafunc.c
+++ src/deltafunc.c
@@ -175,11 +175,11 @@
175 int iNext; /* Next cursor value */
176 };
177
178 /* Operator names:
179 */
180 static const char *const azOp[] = {
181 "SIZE", "COPY", "INSERT", "CHECKSUM", "ERROR", "EOF"
182 };
183 #define DELTAPARSE_OP_SIZE 0
184 #define DELTAPARSE_OP_COPY 1
185 #define DELTAPARSE_OP_INSERT 2
@@ -389,15 +389,15 @@
389 }
390
391 /*
392 ** This method is called to "rewind" the deltaparsevtab_cursor object back
393 ** to the first row of output. This method is always called at least
394 ** once prior to any call to deltaparsevtabColumn() or deltaparsevtabRowid() or
395 ** deltaparsevtabEof().
396 */
397 static int deltaparsevtabFilter(
398 sqlite3_vtab_cursor *pVtabCursor,
399 int idxNum, const char *idxStr,
400 int argc, sqlite3_value **argv
401 ){
402 deltaparsevtab_cursor *pCur = (deltaparsevtab_cursor *)pVtabCursor;
403 const char *a;
@@ -459,11 +459,11 @@
459 pIdxInfo->estimatedRows = 0x7fffffff;
460 return SQLITE_CONSTRAINT;
461 }
462
463 /*
464 ** This following structure defines all the methods for the
465 ** virtual table.
466 */
467 static sqlite3_module deltaparsevtabModule = {
468 /* iVersion */ 0,
469 /* xCreate */ 0,
470
+3 -3
--- src/file.c
+++ src/file.c
@@ -1745,11 +1745,11 @@
17451745
** Return non-NULL if zFilename contains pathname elements that
17461746
** are reserved on Windows. The returned string is the disallowed
17471747
** path element.
17481748
*/
17491749
const char *file_is_win_reserved(const char *zPath){
1750
- static const char *azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" };
1750
+ static const char *const azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" };
17511751
static char zReturn[5];
17521752
int i;
17531753
while( zPath[0] ){
17541754
for(i=0; i<count(azRes); i++){
17551755
if( sqlite3_strnicmp(zPath, azRes[i], 3)==0
@@ -1978,11 +1978,11 @@
19781978
** impossible for fossil to choose between multiple potential
19791979
** timestamps. A non-fatal warning is emitted for such cases.
19801980
**
19811981
*/
19821982
void touch_cmd(){
1983
- const char * zGlobList; /* -g List of glob patterns */
1983
+ const char * zGlobList; /* -g List of glob patterns */
19841984
const char * zGlobFile; /* -G File of glob patterns */
19851985
Glob * pGlob = 0; /* List of glob patterns */
19861986
int verboseFlag;
19871987
int dryRunFlag;
19881988
int vid; /* Checkout version */
@@ -2145,11 +2145,11 @@
21452145
assert(newMtime>0);
21462146
}
21472147
changeCount +=
21482148
touch_cmd_stamp_one_file( zAbs, zArg, newMtime, dryRunFlag,
21492149
verboseFlag, quietFlag );
2150
- }
2150
+ }
21512151
}
21522152
db_end_transaction(0);
21532153
blob_reset(&absBuffer);
21542154
if( dryRunFlag!=0 ){
21552155
fossil_print("dry-run: would have touched %d file(s)\n",
21562156
--- src/file.c
+++ src/file.c
@@ -1745,11 +1745,11 @@
1745 ** Return non-NULL if zFilename contains pathname elements that
1746 ** are reserved on Windows. The returned string is the disallowed
1747 ** path element.
1748 */
1749 const char *file_is_win_reserved(const char *zPath){
1750 static const char *azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" };
1751 static char zReturn[5];
1752 int i;
1753 while( zPath[0] ){
1754 for(i=0; i<count(azRes); i++){
1755 if( sqlite3_strnicmp(zPath, azRes[i], 3)==0
@@ -1978,11 +1978,11 @@
1978 ** impossible for fossil to choose between multiple potential
1979 ** timestamps. A non-fatal warning is emitted for such cases.
1980 **
1981 */
1982 void touch_cmd(){
1983 const char * zGlobList; /* -g List of glob patterns */
1984 const char * zGlobFile; /* -G File of glob patterns */
1985 Glob * pGlob = 0; /* List of glob patterns */
1986 int verboseFlag;
1987 int dryRunFlag;
1988 int vid; /* Checkout version */
@@ -2145,11 +2145,11 @@
2145 assert(newMtime>0);
2146 }
2147 changeCount +=
2148 touch_cmd_stamp_one_file( zAbs, zArg, newMtime, dryRunFlag,
2149 verboseFlag, quietFlag );
2150 }
2151 }
2152 db_end_transaction(0);
2153 blob_reset(&absBuffer);
2154 if( dryRunFlag!=0 ){
2155 fossil_print("dry-run: would have touched %d file(s)\n",
2156
--- src/file.c
+++ src/file.c
@@ -1745,11 +1745,11 @@
1745 ** Return non-NULL if zFilename contains pathname elements that
1746 ** are reserved on Windows. The returned string is the disallowed
1747 ** path element.
1748 */
1749 const char *file_is_win_reserved(const char *zPath){
1750 static const char *const azRes[] = { "CON", "PRN", "AUX", "NUL", "COM", "LPT" };
1751 static char zReturn[5];
1752 int i;
1753 while( zPath[0] ){
1754 for(i=0; i<count(azRes); i++){
1755 if( sqlite3_strnicmp(zPath, azRes[i], 3)==0
@@ -1978,11 +1978,11 @@
1978 ** impossible for fossil to choose between multiple potential
1979 ** timestamps. A non-fatal warning is emitted for such cases.
1980 **
1981 */
1982 void touch_cmd(){
1983 const char * zGlobList; /* -g List of glob patterns */
1984 const char * zGlobFile; /* -G File of glob patterns */
1985 Glob * pGlob = 0; /* List of glob patterns */
1986 int verboseFlag;
1987 int dryRunFlag;
1988 int vid; /* Checkout version */
@@ -2145,11 +2145,11 @@
2145 assert(newMtime>0);
2146 }
2147 changeCount +=
2148 touch_cmd_stamp_one_file( zAbs, zArg, newMtime, dryRunFlag,
2149 verboseFlag, quietFlag );
2150 }
2151 }
2152 db_end_transaction(0);
2153 blob_reset(&absBuffer);
2154 if( dryRunFlag!=0 ){
2155 fossil_print("dry-run: would have touched %d file(s)\n",
2156
+1 -1
--- src/hname.c
+++ src/hname.c
@@ -216,11 +216,11 @@
216216
}
217217
218218
/*
219219
** Names of the hash policies.
220220
*/
221
-static const char *azPolicy[] = {
221
+static const char *const azPolicy[] = {
222222
"sha1", "auto", "sha3", "sha3-only", "shun-sha1"
223223
};
224224
225225
/* Return the name of the current hash policy.
226226
*/
227227
--- src/hname.c
+++ src/hname.c
@@ -216,11 +216,11 @@
216 }
217
218 /*
219 ** Names of the hash policies.
220 */
221 static const char *azPolicy[] = {
222 "sha1", "auto", "sha3", "sha3-only", "shun-sha1"
223 };
224
225 /* Return the name of the current hash policy.
226 */
227
--- src/hname.c
+++ src/hname.c
@@ -216,11 +216,11 @@
216 }
217
218 /*
219 ** Names of the hash policies.
220 */
221 static const char *const azPolicy[] = {
222 "sha1", "auto", "sha3", "sha3-only", "shun-sha1"
223 };
224
225 /* Return the name of the current hash policy.
226 */
227
--- src/http_transport.c
+++ src/http_transport.c
@@ -80,11 +80,11 @@
8080
** Check zFossil to see if it is a reasonable "fossil" command to
8181
** run on the server. Do not allow an attacker to substitute something
8282
** like "/bin/rm".
8383
*/
8484
static int is_safe_fossil_command(const char *zFossil){
85
- static const char *azSafe[] = { "*/fossil", "*/echo" };
85
+ static const char *const azSafe[] = { "*/fossil", "*/echo" };
8686
int i;
8787
for(i=0; i<sizeof(azSafe)/sizeof(azSafe[0]); i++){
8888
if( sqlite3_strglob(azSafe[i], zFossil)==0 ) return 1;
8989
if( strcmp(azSafe[i]+2, zFossil)==0 ) return 1;
9090
}
9191
--- src/http_transport.c
+++ src/http_transport.c
@@ -80,11 +80,11 @@
80 ** Check zFossil to see if it is a reasonable "fossil" command to
81 ** run on the server. Do not allow an attacker to substitute something
82 ** like "/bin/rm".
83 */
84 static int is_safe_fossil_command(const char *zFossil){
85 static const char *azSafe[] = { "*/fossil", "*/echo" };
86 int i;
87 for(i=0; i<sizeof(azSafe)/sizeof(azSafe[0]); i++){
88 if( sqlite3_strglob(azSafe[i], zFossil)==0 ) return 1;
89 if( strcmp(azSafe[i]+2, zFossil)==0 ) return 1;
90 }
91
--- src/http_transport.c
+++ src/http_transport.c
@@ -80,11 +80,11 @@
80 ** Check zFossil to see if it is a reasonable "fossil" command to
81 ** run on the server. Do not allow an attacker to substitute something
82 ** like "/bin/rm".
83 */
84 static int is_safe_fossil_command(const char *zFossil){
85 static const char *const azSafe[] = { "*/fossil", "*/echo" };
86 int i;
87 for(i=0; i<sizeof(azSafe)/sizeof(azSafe[0]); i++){
88 if( sqlite3_strglob(azSafe[i], zFossil)==0 ) return 1;
89 if( strcmp(azSafe[i]+2, zFossil)==0 ) return 1;
90 }
91
+1 -1
--- src/manifest.c
+++ src/manifest.c
@@ -140,11 +140,11 @@
140140
};
141141
142142
/*
143143
** Names of manifest types
144144
*/
145
-static const char *azNameOfMType[] = {
145
+static const char *const azNameOfMType[] = {
146146
"manifest",
147147
"cluster",
148148
"tag",
149149
"wiki",
150150
"ticket",
151151
--- src/manifest.c
+++ src/manifest.c
@@ -140,11 +140,11 @@
140 };
141
142 /*
143 ** Names of manifest types
144 */
145 static const char *azNameOfMType[] = {
146 "manifest",
147 "cluster",
148 "tag",
149 "wiki",
150 "ticket",
151
--- src/manifest.c
+++ src/manifest.c
@@ -140,11 +140,11 @@
140 };
141
142 /*
143 ** Names of manifest types
144 */
145 static const char *const azNameOfMType[] = {
146 "manifest",
147 "cluster",
148 "tag",
149 "wiki",
150 "ticket",
151
+1 -1
--- src/miniz.c
+++ src/miniz.c
@@ -1342,11 +1342,11 @@
13421342
return mz_inflateEnd(&stream);
13431343
}
13441344
13451345
const char *mz_error(int err)
13461346
{
1347
- static struct { int m_err; const char *m_pDesc; } s_error_descs[] =
1347
+ static const struct { int m_err; const char *m_pDesc; } s_error_descs[] =
13481348
{
13491349
{ MZ_OK, "" }, { MZ_STREAM_END, "stream end" }, { MZ_NEED_DICT, "need dictionary" }, { MZ_ERRNO, "file error" }, { MZ_STREAM_ERROR, "stream error" },
13501350
{ MZ_DATA_ERROR, "data error" }, { MZ_MEM_ERROR, "out of memory" }, { MZ_BUF_ERROR, "buf error" }, { MZ_VERSION_ERROR, "version error" }, { MZ_PARAM_ERROR, "parameter error" }
13511351
};
13521352
mz_uint i; for (i = 0; i < sizeof(s_error_descs) / sizeof(s_error_descs[0]); ++i) if (s_error_descs[i].m_err == err) return s_error_descs[i].m_pDesc;
13531353
--- src/miniz.c
+++ src/miniz.c
@@ -1342,11 +1342,11 @@
1342 return mz_inflateEnd(&stream);
1343 }
1344
1345 const char *mz_error(int err)
1346 {
1347 static struct { int m_err; const char *m_pDesc; } s_error_descs[] =
1348 {
1349 { MZ_OK, "" }, { MZ_STREAM_END, "stream end" }, { MZ_NEED_DICT, "need dictionary" }, { MZ_ERRNO, "file error" }, { MZ_STREAM_ERROR, "stream error" },
1350 { MZ_DATA_ERROR, "data error" }, { MZ_MEM_ERROR, "out of memory" }, { MZ_BUF_ERROR, "buf error" }, { MZ_VERSION_ERROR, "version error" }, { MZ_PARAM_ERROR, "parameter error" }
1351 };
1352 mz_uint i; for (i = 0; i < sizeof(s_error_descs) / sizeof(s_error_descs[0]); ++i) if (s_error_descs[i].m_err == err) return s_error_descs[i].m_pDesc;
1353
--- src/miniz.c
+++ src/miniz.c
@@ -1342,11 +1342,11 @@
1342 return mz_inflateEnd(&stream);
1343 }
1344
1345 const char *mz_error(int err)
1346 {
1347 static const struct { int m_err; const char *m_pDesc; } s_error_descs[] =
1348 {
1349 { MZ_OK, "" }, { MZ_STREAM_END, "stream end" }, { MZ_NEED_DICT, "need dictionary" }, { MZ_ERRNO, "file error" }, { MZ_STREAM_ERROR, "stream error" },
1350 { MZ_DATA_ERROR, "data error" }, { MZ_MEM_ERROR, "out of memory" }, { MZ_BUF_ERROR, "buf error" }, { MZ_VERSION_ERROR, "version error" }, { MZ_PARAM_ERROR, "parameter error" }
1351 };
1352 mz_uint i; for (i = 0; i < sizeof(s_error_descs) / sizeof(s_error_descs[0]); ++i) if (s_error_descs[i].m_err == err) return s_error_descs[i].m_pDesc;
1353
+2 -2
--- src/search.c
+++ src/search.c
@@ -1110,11 +1110,11 @@
11101110
}else{
11111111
@ <div class='searchForm'>
11121112
}
11131113
@ <input type="text" name="s" size="40" value="%h(zPattern)"%s(zDisable1)>
11141114
if( (mFlags & 0x01)!=0 && (srchFlags & (srchFlags-1))!=0 ){
1115
- static const struct { char *z; char *zNm; unsigned m; } aY[] = {
1115
+ static const struct { const char *z; const char *zNm; unsigned m; } aY[] = {
11161116
{ "all", "All", SRCH_ALL },
11171117
{ "c", "Check-ins", SRCH_CKIN },
11181118
{ "d", "Docs", SRCH_DOC },
11191119
{ "t", "Tickets", SRCH_TKT },
11201120
{ "w", "Wiki", SRCH_WIKI },
@@ -1842,11 +1842,11 @@
18421842
{ 2, "index" },
18431843
{ 3, "disable" },
18441844
{ 4, "enable" },
18451845
{ 5, "stemmer" },
18461846
};
1847
- static const struct { char *zSetting; char *zName; char *zSw; } aSetng[] = {
1847
+ static const struct { const char *zSetting; const char *zName; const char *zSw; } aSetng[] = {
18481848
{ "search-ci", "check-in search:", "c" },
18491849
{ "search-doc", "document search:", "d" },
18501850
{ "search-tkt", "ticket search:", "t" },
18511851
{ "search-wiki", "wiki search:", "w" },
18521852
{ "search-technote", "tech note search:", "e" },
18531853
--- src/search.c
+++ src/search.c
@@ -1110,11 +1110,11 @@
1110 }else{
1111 @ <div class='searchForm'>
1112 }
1113 @ <input type="text" name="s" size="40" value="%h(zPattern)"%s(zDisable1)>
1114 if( (mFlags & 0x01)!=0 && (srchFlags & (srchFlags-1))!=0 ){
1115 static const struct { char *z; char *zNm; unsigned m; } aY[] = {
1116 { "all", "All", SRCH_ALL },
1117 { "c", "Check-ins", SRCH_CKIN },
1118 { "d", "Docs", SRCH_DOC },
1119 { "t", "Tickets", SRCH_TKT },
1120 { "w", "Wiki", SRCH_WIKI },
@@ -1842,11 +1842,11 @@
1842 { 2, "index" },
1843 { 3, "disable" },
1844 { 4, "enable" },
1845 { 5, "stemmer" },
1846 };
1847 static const struct { char *zSetting; char *zName; char *zSw; } aSetng[] = {
1848 { "search-ci", "check-in search:", "c" },
1849 { "search-doc", "document search:", "d" },
1850 { "search-tkt", "ticket search:", "t" },
1851 { "search-wiki", "wiki search:", "w" },
1852 { "search-technote", "tech note search:", "e" },
1853
--- src/search.c
+++ src/search.c
@@ -1110,11 +1110,11 @@
1110 }else{
1111 @ <div class='searchForm'>
1112 }
1113 @ <input type="text" name="s" size="40" value="%h(zPattern)"%s(zDisable1)>
1114 if( (mFlags & 0x01)!=0 && (srchFlags & (srchFlags-1))!=0 ){
1115 static const struct { const char *z; const char *zNm; unsigned m; } aY[] = {
1116 { "all", "All", SRCH_ALL },
1117 { "c", "Check-ins", SRCH_CKIN },
1118 { "d", "Docs", SRCH_DOC },
1119 { "t", "Tickets", SRCH_TKT },
1120 { "w", "Wiki", SRCH_WIKI },
@@ -1842,11 +1842,11 @@
1842 { 2, "index" },
1843 { 3, "disable" },
1844 { 4, "enable" },
1845 { 5, "stemmer" },
1846 };
1847 static const struct { const char *zSetting; const char *zName; const char *zSw; } aSetng[] = {
1848 { "search-ci", "check-in search:", "c" },
1849 { "search-doc", "document search:", "d" },
1850 { "search-tkt", "ticket search:", "t" },
1851 { "search-wiki", "wiki search:", "w" },
1852 { "search-technote", "tech note search:", "e" },
1853
+5 -5
--- src/setup.c
+++ src/setup.c
@@ -312,11 +312,11 @@
312312
** WEBPAGE: setup_access
313313
**
314314
** The access-control settings page. Requires Setup privileges.
315315
*/
316316
void setup_access(void){
317
- static const char * const azRedirectOpts[] = {
317
+ static const char *const azRedirectOpts[] = {
318318
"0", "Off",
319319
"1", "Login Page Only",
320320
"2", "All Pages"
321321
};
322322
login_check_credentials();
@@ -332,11 +332,11 @@
332332
@ <input type="submit" name="submit" value="Apply Changes" /></p>
333333
@ <hr />
334334
multiple_choice_attribute("Redirect to HTTPS",
335335
"redirect-to-https", "redirhttps", "0",
336336
count(azRedirectOpts)/2, azRedirectOpts);
337
- @ <p>Force the use of HTTPS by redirecting to HTTPS when an
337
+ @ <p>Force the use of HTTPS by redirecting to HTTPS when an
338338
@ unencrypted request is received. This feature can be enabled
339339
@ for the Login page only, or for all pages.
340340
@ <p>Further details: When enabled, this option causes the $secureurl TH1
341341
@ variable is set to an "https:" variant of $baseurl. Otherwise,
342342
@ $secureurl is just an alias for $baseurl.
@@ -916,11 +916,11 @@
916916
@ If no tarball prefix is specified, then the full Project Name above is used.
917917
@ (Property: "short-project-name")
918918
@ </p>
919919
@ <hr />
920920
entry_attribute("Download Tag", 20, "download-tag", "dlt", "trunk", 0);
921
- @ <p>The <a href='%R/download'>/download</a> page is designed to provide
921
+ @ <p>The <a href='%R/download'>/download</a> page is designed to provide
922922
@ a convenient place for newbies
923923
@ to download a ZIP archive or a tarball of the project. By default,
924924
@ the latest trunk check-in is downloaded. Change this tag to something
925925
@ else (ex: release) to alter the behavior of the /download page.
926926
@ (Property: "download-tag")
@@ -947,12 +947,12 @@
947947
@ "<b>/home</b>" will work but "<b>home</b>" will not, since it omits the
948948
@ leading "/".</p>
949949
@ <p>(Property: "index-page")
950950
@ <hr>
951951
@ <p>Extra links to appear on the <a href="%R/sitemap">/sitemap</a> page.
952
- @ Often these are filled in with links like
953
- @ "/doc/trunk/doc/<i>filename</i>.md" so that they refer to
952
+ @ Often these are filled in with links like
953
+ @ "/doc/trunk/doc/<i>filename</i>.md" so that they refer to
954954
@ embedded documentation, or like "/wiki/<i>pagename</i>" to refer
955955
@ to wiki pages.
956956
@ Leave blank to omit.
957957
@ <p>
958958
entry_attribute("Documentation Index", 40, "sitemap-docidx", "smdocidx",
959959
--- src/setup.c
+++ src/setup.c
@@ -312,11 +312,11 @@
312 ** WEBPAGE: setup_access
313 **
314 ** The access-control settings page. Requires Setup privileges.
315 */
316 void setup_access(void){
317 static const char * const azRedirectOpts[] = {
318 "0", "Off",
319 "1", "Login Page Only",
320 "2", "All Pages"
321 };
322 login_check_credentials();
@@ -332,11 +332,11 @@
332 @ <input type="submit" name="submit" value="Apply Changes" /></p>
333 @ <hr />
334 multiple_choice_attribute("Redirect to HTTPS",
335 "redirect-to-https", "redirhttps", "0",
336 count(azRedirectOpts)/2, azRedirectOpts);
337 @ <p>Force the use of HTTPS by redirecting to HTTPS when an
338 @ unencrypted request is received. This feature can be enabled
339 @ for the Login page only, or for all pages.
340 @ <p>Further details: When enabled, this option causes the $secureurl TH1
341 @ variable is set to an "https:" variant of $baseurl. Otherwise,
342 @ $secureurl is just an alias for $baseurl.
@@ -916,11 +916,11 @@
916 @ If no tarball prefix is specified, then the full Project Name above is used.
917 @ (Property: "short-project-name")
918 @ </p>
919 @ <hr />
920 entry_attribute("Download Tag", 20, "download-tag", "dlt", "trunk", 0);
921 @ <p>The <a href='%R/download'>/download</a> page is designed to provide
922 @ a convenient place for newbies
923 @ to download a ZIP archive or a tarball of the project. By default,
924 @ the latest trunk check-in is downloaded. Change this tag to something
925 @ else (ex: release) to alter the behavior of the /download page.
926 @ (Property: "download-tag")
@@ -947,12 +947,12 @@
947 @ "<b>/home</b>" will work but "<b>home</b>" will not, since it omits the
948 @ leading "/".</p>
949 @ <p>(Property: "index-page")
950 @ <hr>
951 @ <p>Extra links to appear on the <a href="%R/sitemap">/sitemap</a> page.
952 @ Often these are filled in with links like
953 @ "/doc/trunk/doc/<i>filename</i>.md" so that they refer to
954 @ embedded documentation, or like "/wiki/<i>pagename</i>" to refer
955 @ to wiki pages.
956 @ Leave blank to omit.
957 @ <p>
958 entry_attribute("Documentation Index", 40, "sitemap-docidx", "smdocidx",
959
--- src/setup.c
+++ src/setup.c
@@ -312,11 +312,11 @@
312 ** WEBPAGE: setup_access
313 **
314 ** The access-control settings page. Requires Setup privileges.
315 */
316 void setup_access(void){
317 static const char *const azRedirectOpts[] = {
318 "0", "Off",
319 "1", "Login Page Only",
320 "2", "All Pages"
321 };
322 login_check_credentials();
@@ -332,11 +332,11 @@
332 @ <input type="submit" name="submit" value="Apply Changes" /></p>
333 @ <hr />
334 multiple_choice_attribute("Redirect to HTTPS",
335 "redirect-to-https", "redirhttps", "0",
336 count(azRedirectOpts)/2, azRedirectOpts);
337 @ <p>Force the use of HTTPS by redirecting to HTTPS when an
338 @ unencrypted request is received. This feature can be enabled
339 @ for the Login page only, or for all pages.
340 @ <p>Further details: When enabled, this option causes the $secureurl TH1
341 @ variable is set to an "https:" variant of $baseurl. Otherwise,
342 @ $secureurl is just an alias for $baseurl.
@@ -916,11 +916,11 @@
916 @ If no tarball prefix is specified, then the full Project Name above is used.
917 @ (Property: "short-project-name")
918 @ </p>
919 @ <hr />
920 entry_attribute("Download Tag", 20, "download-tag", "dlt", "trunk", 0);
921 @ <p>The <a href='%R/download'>/download</a> page is designed to provide
922 @ a convenient place for newbies
923 @ to download a ZIP archive or a tarball of the project. By default,
924 @ the latest trunk check-in is downloaded. Change this tag to something
925 @ else (ex: release) to alter the behavior of the /download page.
926 @ (Property: "download-tag")
@@ -947,12 +947,12 @@
947 @ "<b>/home</b>" will work but "<b>home</b>" will not, since it omits the
948 @ leading "/".</p>
949 @ <p>(Property: "index-page")
950 @ <hr>
951 @ <p>Extra links to appear on the <a href="%R/sitemap">/sitemap</a> page.
952 @ Often these are filled in with links like
953 @ "/doc/trunk/doc/<i>filename</i>.md" so that they refer to
954 @ embedded documentation, or like "/wiki/<i>pagename</i>" to refer
955 @ to wiki pages.
956 @ Leave blank to omit.
957 @ <p>
958 entry_attribute("Documentation Index", 40, "sitemap-docidx", "smdocidx",
959
+1 -1
--- src/shun.c
+++ src/shun.c
@@ -381,11 +381,11 @@
381381
const char *zUser = db_column_text(&q, 1);
382382
const char *zDate = db_column_text(&q, 2);
383383
const char *zIpAddr = db_column_text(&q, 3);
384384
int usesSha1 = db_column_int(&q, 5)!=0;
385385
int usesSha3 = db_column_int(&q, 6)!=0;
386
- static const char *zHashType[] = { "", "sha1", "sha3", "both" };
386
+ static const char *const zHashType[] = { "", "sha1", "sha3", "both" };
387387
const char *zHash = zHashType[usesSha1+usesSha3*2];
388388
if( cnt==perScreen && !showAll ){
389389
style_submenu_element("Older", "rcvfromlist?ofst=%d", ofst+perScreen);
390390
}else{
391391
cnt++;
392392
--- src/shun.c
+++ src/shun.c
@@ -381,11 +381,11 @@
381 const char *zUser = db_column_text(&q, 1);
382 const char *zDate = db_column_text(&q, 2);
383 const char *zIpAddr = db_column_text(&q, 3);
384 int usesSha1 = db_column_int(&q, 5)!=0;
385 int usesSha3 = db_column_int(&q, 6)!=0;
386 static const char *zHashType[] = { "", "sha1", "sha3", "both" };
387 const char *zHash = zHashType[usesSha1+usesSha3*2];
388 if( cnt==perScreen && !showAll ){
389 style_submenu_element("Older", "rcvfromlist?ofst=%d", ofst+perScreen);
390 }else{
391 cnt++;
392
--- src/shun.c
+++ src/shun.c
@@ -381,11 +381,11 @@
381 const char *zUser = db_column_text(&q, 1);
382 const char *zDate = db_column_text(&q, 2);
383 const char *zIpAddr = db_column_text(&q, 3);
384 int usesSha1 = db_column_int(&q, 5)!=0;
385 int usesSha3 = db_column_int(&q, 6)!=0;
386 static const char *const zHashType[] = { "", "sha1", "sha3", "both" };
387 const char *zHash = zHashType[usesSha1+usesSha3*2];
388 if( cnt==perScreen && !showAll ){
389 style_submenu_element("Older", "rcvfromlist?ofst=%d", ofst+perScreen);
390 }else{
391 cnt++;
392
+5 -5
--- src/skins.c
+++ src/skins.c
@@ -57,11 +57,11 @@
5757
};
5858
5959
/*
6060
** A skin consists of five "files" named here:
6161
*/
62
-static const char *azSkinFile[] = {
62
+static const char *const azSkinFile[] = {
6363
"css", "header", "footer", "details", "js"
6464
};
6565
6666
/*
6767
** Alternative skins can be specified in the CGI script or by options
@@ -498,15 +498,15 @@
498498
}
499499
if( skinRename() || skinSave(zCurrent) ){
500500
db_end_transaction(0);
501501
return;
502502
}
503
-
503
+
504504
/* The user pressed one of the "Install" buttons. */
505505
if( P("load") && (z = P("sn"))!=0 && z[0] ){
506506
int seen = 0;
507
-
507
+
508508
/* Check to see if the current skin is already saved. If it is, there
509509
** is no need to create a backup */
510510
zCurrent = getSkin(0);
511511
for(i=0; i<count(aBuiltinSkin); i++){
512512
if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){
@@ -539,11 +539,11 @@
539539
zCurrent = db_get(zName, 0);
540540
db_multi_exec("%s", zCurrent/*safe-for-%s*/);
541541
}
542542
}
543543
}
544
-
544
+
545545
style_header("Skins");
546546
if( zErr ){
547547
@ <p style="color:red">%h(zErr)</p>
548548
}
549549
@ <table border="0">
@@ -881,11 +881,11 @@
881881
int iSkin; /* Which draft skin is being edited */
882882
int isSetup; /* True for an administrator */
883883
int isEditor; /* Others authorized to make edits */
884884
char *zAllowedEditors; /* Who may edit the draft skin */
885885
char *zBase; /* Base URL for draft under test */
886
- static const char *azTestPages[] = {
886
+ static const char *const azTestPages[] = {
887887
"home",
888888
"timeline",
889889
"dir?ci=tip",
890890
"dir?ci=tip&type=tree",
891891
"brlist",
892892
--- src/skins.c
+++ src/skins.c
@@ -57,11 +57,11 @@
57 };
58
59 /*
60 ** A skin consists of five "files" named here:
61 */
62 static const char *azSkinFile[] = {
63 "css", "header", "footer", "details", "js"
64 };
65
66 /*
67 ** Alternative skins can be specified in the CGI script or by options
@@ -498,15 +498,15 @@
498 }
499 if( skinRename() || skinSave(zCurrent) ){
500 db_end_transaction(0);
501 return;
502 }
503
504 /* The user pressed one of the "Install" buttons. */
505 if( P("load") && (z = P("sn"))!=0 && z[0] ){
506 int seen = 0;
507
508 /* Check to see if the current skin is already saved. If it is, there
509 ** is no need to create a backup */
510 zCurrent = getSkin(0);
511 for(i=0; i<count(aBuiltinSkin); i++){
512 if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){
@@ -539,11 +539,11 @@
539 zCurrent = db_get(zName, 0);
540 db_multi_exec("%s", zCurrent/*safe-for-%s*/);
541 }
542 }
543 }
544
545 style_header("Skins");
546 if( zErr ){
547 @ <p style="color:red">%h(zErr)</p>
548 }
549 @ <table border="0">
@@ -881,11 +881,11 @@
881 int iSkin; /* Which draft skin is being edited */
882 int isSetup; /* True for an administrator */
883 int isEditor; /* Others authorized to make edits */
884 char *zAllowedEditors; /* Who may edit the draft skin */
885 char *zBase; /* Base URL for draft under test */
886 static const char *azTestPages[] = {
887 "home",
888 "timeline",
889 "dir?ci=tip",
890 "dir?ci=tip&type=tree",
891 "brlist",
892
--- src/skins.c
+++ src/skins.c
@@ -57,11 +57,11 @@
57 };
58
59 /*
60 ** A skin consists of five "files" named here:
61 */
62 static const char *const azSkinFile[] = {
63 "css", "header", "footer", "details", "js"
64 };
65
66 /*
67 ** Alternative skins can be specified in the CGI script or by options
@@ -498,15 +498,15 @@
498 }
499 if( skinRename() || skinSave(zCurrent) ){
500 db_end_transaction(0);
501 return;
502 }
503
504 /* The user pressed one of the "Install" buttons. */
505 if( P("load") && (z = P("sn"))!=0 && z[0] ){
506 int seen = 0;
507
508 /* Check to see if the current skin is already saved. If it is, there
509 ** is no need to create a backup */
510 zCurrent = getSkin(0);
511 for(i=0; i<count(aBuiltinSkin); i++){
512 if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){
@@ -539,11 +539,11 @@
539 zCurrent = db_get(zName, 0);
540 db_multi_exec("%s", zCurrent/*safe-for-%s*/);
541 }
542 }
543 }
544
545 style_header("Skins");
546 if( zErr ){
547 @ <p style="color:red">%h(zErr)</p>
548 }
549 @ <table border="0">
@@ -881,11 +881,11 @@
881 int iSkin; /* Which draft skin is being edited */
882 int isSetup; /* True for an administrator */
883 int isEditor; /* Others authorized to make edits */
884 char *zAllowedEditors; /* Who may edit the draft skin */
885 char *zBase; /* Base URL for draft under test */
886 static const char *const azTestPages[] = {
887 "home",
888 "timeline",
889 "dir?ci=tip",
890 "dir?ci=tip&type=tree",
891 "brlist",
892
+10 -10
--- src/smtp.c
+++ src/smtp.c
@@ -116,11 +116,11 @@
116116
pBest = p->Data.MX.pNameExchange;
117117
}
118118
p = p->pNext;
119119
}
120120
if( pBest ){
121
- pBest = fossil_strdup(pBest);
121
+ pBest = fossil_strdup(pBest);
122122
}
123123
DnsRecordListFree(pDnsRecord, DnsFreeRecordListDeep);
124124
return pBest;
125125
#else
126126
return 0;
@@ -646,11 +646,11 @@
646646
*****************************************************************************/
647647
648648
/*
649649
** Schema used by the email processing system.
650650
*/
651
-static const char zEmailSchema[] =
651
+static const char zEmailSchema[] =
652652
@ -- bulk storage is in this table. This table can store either
653653
@ -- the body of email messages or transcripts of an smtp session.
654654
@ CREATE TABLE IF NOT EXISTS repository.emailblob(
655655
@ emailid INTEGER PRIMARY KEY AUTOINCREMENT, -- numeric idea for the entry
656656
@ enref INT, -- Number of references to this blob
@@ -903,21 +903,21 @@
903903
@ <input type="submit" name="cancel" value="Cancel">
904904
@ </tr>
905905
@ </table>
906906
@ <hr>
907907
@ <h1>Instructions</h1>
908
- @
908
+ @
909909
@ <p>The "Routing" field consists of zero or more lines where each
910910
@ line is an "action" followed by an "argument". Available actions:
911911
@ <ul>
912912
@ <li><p><b>forward</b> <i>email-address</i>
913913
@ <p>Forward the message to <i>email-address</i>.
914914
@ <li><p><b>mbox</b> <i>login-name</i>
915915
@ <p>Store the message in the local mailbox for the user
916916
@ with USER.LOGIN=<i>login-name</i>.
917917
@ </ul>
918
- @
918
+ @
919919
@ <p>To delete a route &rarr; erase all text from the "Routing" field then
920920
@ press the "Apply" button.
921921
style_footer();
922922
}
923923
@@ -951,11 +951,11 @@
951951
952952
#endif /* LOCAL_INTERFACE */
953953
954954
/*
955955
** Clear the SmtpServer object. Deallocate resources.
956
-** How much to clear depends on eHowMuch
956
+** How much to clear depends on eHowMuch
957957
*/
958958
static void smtp_server_clear(SmtpServer *p, int eHowMuch){
959959
int i;
960960
if( eHowMuch>=SMTPSRV_CLEAR_MSG ){
961961
fossil_free(p->zFrom);
@@ -1095,11 +1095,11 @@
10951095
int okRemote /* True if ok to foward to another domain */
10961096
){
10971097
char *zPolicy;
10981098
Blob policy, line, token, tail;
10991099
1100
- zPolicy = db_text(0,
1100
+ zPolicy = db_text(0,
11011101
"SELECT epolicy FROM emailroute WHERE eaddr=%Q", zAddr);
11021102
if( zPolicy==0 ){
11031103
if( okRemote ){
11041104
int i;
11051105
for(i=0; zAddr[i] && zAddr[i]!='@'; i++){}
@@ -1204,11 +1204,11 @@
12041204
}
12051205
12061206
/* Fix up the emailblob.enref field of the email message body */
12071207
if( p->nRef ){
12081208
db_multi_exec(
1209
- "UPDATE emailblob SET enref=%d WHERE emailid=%lld",
1209
+ "UPDATE emailblob SET enref=%d WHERE emailid=%lld",
12101210
p->nRef, p->idMsg
12111211
);
12121212
}else{
12131213
db_multi_exec(
12141214
"DELETE FROM emailblob WHERE emailid=%lld", p->idMsg
@@ -1286,11 +1286,11 @@
12861286
if( doClean ){
12871287
smtp_cleanup();
12881288
}
12891289
}
12901290
blob_init(&sql, 0, 0);
1291
- blob_append_sql(&sql,
1291
+ blob_append_sql(&sql,
12921292
"SELECT a.emailid, a.enref, b.n"
12931293
" FROM emailblob AS a JOIN refcnt AS b ON a.emailid=b.id"
12941294
);
12951295
if( !fullReport ){
12961296
blob_append_sql(&sql, " WHERE a.enref!=b.n");
@@ -1514,11 +1514,11 @@
15141514
}
15151515
pop3_print(pLog, "+OK");
15161516
break;
15171517
}
15181518
if( strcmp(zCmd,"capa")==0 ){
1519
- static const char *azCap[] = {
1519
+ static const char *const azCap[] = {
15201520
"TOP", "USER", "UIDL",
15211521
};
15221522
int i;
15231523
pop3_print(pLog, "+OK");
15241524
for(i=0; i<sizeof(azCap)/sizeof(azCap[0]); i++){
@@ -1552,11 +1552,11 @@
15521552
" WHERE emailid=emsgid AND euser=%Q AND estate<=1"
15531553
" ORDER BY edate;",
15541554
zUser
15551555
);
15561556
goto cmd_ok;
1557
- }
1557
+ }
15581558
}
15591559
/* Fossil cannot process APOP since the users clear-text password is
15601560
** unknown. */
15611561
goto cmd_error;
15621562
}else{
15631563
--- src/smtp.c
+++ src/smtp.c
@@ -116,11 +116,11 @@
116 pBest = p->Data.MX.pNameExchange;
117 }
118 p = p->pNext;
119 }
120 if( pBest ){
121 pBest = fossil_strdup(pBest);
122 }
123 DnsRecordListFree(pDnsRecord, DnsFreeRecordListDeep);
124 return pBest;
125 #else
126 return 0;
@@ -646,11 +646,11 @@
646 *****************************************************************************/
647
648 /*
649 ** Schema used by the email processing system.
650 */
651 static const char zEmailSchema[] =
652 @ -- bulk storage is in this table. This table can store either
653 @ -- the body of email messages or transcripts of an smtp session.
654 @ CREATE TABLE IF NOT EXISTS repository.emailblob(
655 @ emailid INTEGER PRIMARY KEY AUTOINCREMENT, -- numeric idea for the entry
656 @ enref INT, -- Number of references to this blob
@@ -903,21 +903,21 @@
903 @ <input type="submit" name="cancel" value="Cancel">
904 @ </tr>
905 @ </table>
906 @ <hr>
907 @ <h1>Instructions</h1>
908 @
909 @ <p>The "Routing" field consists of zero or more lines where each
910 @ line is an "action" followed by an "argument". Available actions:
911 @ <ul>
912 @ <li><p><b>forward</b> <i>email-address</i>
913 @ <p>Forward the message to <i>email-address</i>.
914 @ <li><p><b>mbox</b> <i>login-name</i>
915 @ <p>Store the message in the local mailbox for the user
916 @ with USER.LOGIN=<i>login-name</i>.
917 @ </ul>
918 @
919 @ <p>To delete a route &rarr; erase all text from the "Routing" field then
920 @ press the "Apply" button.
921 style_footer();
922 }
923
@@ -951,11 +951,11 @@
951
952 #endif /* LOCAL_INTERFACE */
953
954 /*
955 ** Clear the SmtpServer object. Deallocate resources.
956 ** How much to clear depends on eHowMuch
957 */
958 static void smtp_server_clear(SmtpServer *p, int eHowMuch){
959 int i;
960 if( eHowMuch>=SMTPSRV_CLEAR_MSG ){
961 fossil_free(p->zFrom);
@@ -1095,11 +1095,11 @@
1095 int okRemote /* True if ok to foward to another domain */
1096 ){
1097 char *zPolicy;
1098 Blob policy, line, token, tail;
1099
1100 zPolicy = db_text(0,
1101 "SELECT epolicy FROM emailroute WHERE eaddr=%Q", zAddr);
1102 if( zPolicy==0 ){
1103 if( okRemote ){
1104 int i;
1105 for(i=0; zAddr[i] && zAddr[i]!='@'; i++){}
@@ -1204,11 +1204,11 @@
1204 }
1205
1206 /* Fix up the emailblob.enref field of the email message body */
1207 if( p->nRef ){
1208 db_multi_exec(
1209 "UPDATE emailblob SET enref=%d WHERE emailid=%lld",
1210 p->nRef, p->idMsg
1211 );
1212 }else{
1213 db_multi_exec(
1214 "DELETE FROM emailblob WHERE emailid=%lld", p->idMsg
@@ -1286,11 +1286,11 @@
1286 if( doClean ){
1287 smtp_cleanup();
1288 }
1289 }
1290 blob_init(&sql, 0, 0);
1291 blob_append_sql(&sql,
1292 "SELECT a.emailid, a.enref, b.n"
1293 " FROM emailblob AS a JOIN refcnt AS b ON a.emailid=b.id"
1294 );
1295 if( !fullReport ){
1296 blob_append_sql(&sql, " WHERE a.enref!=b.n");
@@ -1514,11 +1514,11 @@
1514 }
1515 pop3_print(pLog, "+OK");
1516 break;
1517 }
1518 if( strcmp(zCmd,"capa")==0 ){
1519 static const char *azCap[] = {
1520 "TOP", "USER", "UIDL",
1521 };
1522 int i;
1523 pop3_print(pLog, "+OK");
1524 for(i=0; i<sizeof(azCap)/sizeof(azCap[0]); i++){
@@ -1552,11 +1552,11 @@
1552 " WHERE emailid=emsgid AND euser=%Q AND estate<=1"
1553 " ORDER BY edate;",
1554 zUser
1555 );
1556 goto cmd_ok;
1557 }
1558 }
1559 /* Fossil cannot process APOP since the users clear-text password is
1560 ** unknown. */
1561 goto cmd_error;
1562 }else{
1563
--- src/smtp.c
+++ src/smtp.c
@@ -116,11 +116,11 @@
116 pBest = p->Data.MX.pNameExchange;
117 }
118 p = p->pNext;
119 }
120 if( pBest ){
121 pBest = fossil_strdup(pBest);
122 }
123 DnsRecordListFree(pDnsRecord, DnsFreeRecordListDeep);
124 return pBest;
125 #else
126 return 0;
@@ -646,11 +646,11 @@
646 *****************************************************************************/
647
648 /*
649 ** Schema used by the email processing system.
650 */
651 static const char zEmailSchema[] =
652 @ -- bulk storage is in this table. This table can store either
653 @ -- the body of email messages or transcripts of an smtp session.
654 @ CREATE TABLE IF NOT EXISTS repository.emailblob(
655 @ emailid INTEGER PRIMARY KEY AUTOINCREMENT, -- numeric idea for the entry
656 @ enref INT, -- Number of references to this blob
@@ -903,21 +903,21 @@
903 @ <input type="submit" name="cancel" value="Cancel">
904 @ </tr>
905 @ </table>
906 @ <hr>
907 @ <h1>Instructions</h1>
908 @
909 @ <p>The "Routing" field consists of zero or more lines where each
910 @ line is an "action" followed by an "argument". Available actions:
911 @ <ul>
912 @ <li><p><b>forward</b> <i>email-address</i>
913 @ <p>Forward the message to <i>email-address</i>.
914 @ <li><p><b>mbox</b> <i>login-name</i>
915 @ <p>Store the message in the local mailbox for the user
916 @ with USER.LOGIN=<i>login-name</i>.
917 @ </ul>
918 @
919 @ <p>To delete a route &rarr; erase all text from the "Routing" field then
920 @ press the "Apply" button.
921 style_footer();
922 }
923
@@ -951,11 +951,11 @@
951
952 #endif /* LOCAL_INTERFACE */
953
954 /*
955 ** Clear the SmtpServer object. Deallocate resources.
956 ** How much to clear depends on eHowMuch
957 */
958 static void smtp_server_clear(SmtpServer *p, int eHowMuch){
959 int i;
960 if( eHowMuch>=SMTPSRV_CLEAR_MSG ){
961 fossil_free(p->zFrom);
@@ -1095,11 +1095,11 @@
1095 int okRemote /* True if ok to foward to another domain */
1096 ){
1097 char *zPolicy;
1098 Blob policy, line, token, tail;
1099
1100 zPolicy = db_text(0,
1101 "SELECT epolicy FROM emailroute WHERE eaddr=%Q", zAddr);
1102 if( zPolicy==0 ){
1103 if( okRemote ){
1104 int i;
1105 for(i=0; zAddr[i] && zAddr[i]!='@'; i++){}
@@ -1204,11 +1204,11 @@
1204 }
1205
1206 /* Fix up the emailblob.enref field of the email message body */
1207 if( p->nRef ){
1208 db_multi_exec(
1209 "UPDATE emailblob SET enref=%d WHERE emailid=%lld",
1210 p->nRef, p->idMsg
1211 );
1212 }else{
1213 db_multi_exec(
1214 "DELETE FROM emailblob WHERE emailid=%lld", p->idMsg
@@ -1286,11 +1286,11 @@
1286 if( doClean ){
1287 smtp_cleanup();
1288 }
1289 }
1290 blob_init(&sql, 0, 0);
1291 blob_append_sql(&sql,
1292 "SELECT a.emailid, a.enref, b.n"
1293 " FROM emailblob AS a JOIN refcnt AS b ON a.emailid=b.id"
1294 );
1295 if( !fullReport ){
1296 blob_append_sql(&sql, " WHERE a.enref!=b.n");
@@ -1514,11 +1514,11 @@
1514 }
1515 pop3_print(pLog, "+OK");
1516 break;
1517 }
1518 if( strcmp(zCmd,"capa")==0 ){
1519 static const char *const azCap[] = {
1520 "TOP", "USER", "UIDL",
1521 };
1522 int i;
1523 pop3_print(pLog, "+OK");
1524 for(i=0; i<sizeof(azCap)/sizeof(azCap[0]); i++){
@@ -1552,11 +1552,11 @@
1552 " WHERE emailid=emsgid AND euser=%Q AND estate<=1"
1553 " ORDER BY edate;",
1554 zUser
1555 );
1556 goto cmd_ok;
1557 }
1558 }
1559 /* Fossil cannot process APOP since the users clear-text password is
1560 ** unknown. */
1561 goto cmd_error;
1562 }else{
1563
+6 -6
--- src/timeline.c
+++ src/timeline.c
@@ -1187,11 +1187,11 @@
11871187
case 'c': tmFlags = TIMELINE_COMPACT; break;
11881188
case 'v': tmFlags = TIMELINE_VERBOSE; break;
11891189
case 'j': tmFlags = TIMELINE_COLUMNAR; break;
11901190
case 'x': tmFlags = TIMELINE_CLASSIC; break;
11911191
default: tmFlags = TIMELINE_MODERN; break;
1192
- }
1192
+ }
11931193
return tmFlags;
11941194
}
11951195
11961196
/*
11971197
** Add the select/option box to the timeline submenu that is used to
@@ -1198,11 +1198,11 @@
11981198
** set the ss= parameter that determines the viewing mode.
11991199
**
12001200
** Return the TIMELINE_* value appropriate for the view-style.
12011201
*/
12021202
int timeline_ss_submenu(void){
1203
- static const char *azViewStyles[] = {
1203
+ static const char *const azViewStyles[] = {
12041204
"m", "Modern View",
12051205
"j", "Columnar View",
12061206
"c", "Compact View",
12071207
"v", "Verbose View",
12081208
"x", "Classic View",
@@ -1627,11 +1627,11 @@
16271627
z = "50";
16281628
nEntry = 50;
16291629
}
16301630
cgi_replace_query_parameter("n",z);
16311631
cookie_write_parameter("n","n",0);
1632
- tmFlags |= timeline_ss_submenu();
1632
+ tmFlags |= timeline_ss_submenu();
16331633
cookie_link_parameter("advm","advm","0");
16341634
advancedMenu = atoi(PD("advm","0"));
16351635
16361636
/* Omit all cherry-pick merge lines if the "ncp" query parameter is
16371637
** present or if this repository lacks a "cherrypick" table. */
@@ -2036,11 +2036,11 @@
20362036
if( z && z[0] ){
20372037
zYearWeekStart = db_text(0, "SELECT date(%Q,'-6 days','weekday 1')",
20382038
zYearWeek);
20392039
zYearWeek = z;
20402040
}else{
2041
- if( strlen(zYearWeek)==7 ){
2041
+ if( strlen(zYearWeek)==7 ){
20422042
zYearWeekStart = db_text(0,
20432043
"SELECT date('%.4q-01-01','+%d days','weekday 1')",
20442044
zYearWeek, atoi(zYearWeek+5)*7);
20452045
}else{
20462046
zYearWeekStart = 0;
@@ -2244,11 +2244,11 @@
22442244
n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/");
22452245
zPlural = n==1 ? "" : "s";
22462246
if( zYearMonth ){
22472247
blob_appendf(&desc, "%d %s%s for %h", n, zEType, zPlural, zYearMonth);
22482248
}else if( zYearWeek ){
2249
- blob_appendf(&desc, "%d %s%s for week %h beginning on %h",
2249
+ blob_appendf(&desc, "%d %s%s for week %h beginning on %h",
22502250
n, zEType, zPlural, zYearWeek, zYearWeekStart);
22512251
}else if( zDay ){
22522252
blob_appendf(&desc, "%d %s%s occurring on %h", n, zEType, zPlural, zDay);
22532253
}else if( zNDays ){
22542254
blob_appendf(&desc, "%d %s%s within the past %d day%s",
@@ -2371,11 +2371,11 @@
23712371
}
23722372
if( search_restrict(SRCH_CKIN)!=0 ){
23732373
style_submenu_element("Search", "%R/search?y=c");
23742374
}
23752375
if( advancedMenu ){
2376
- style_submenu_element("Basic", "%s",
2376
+ style_submenu_element("Basic", "%s",
23772377
url_render(&url, "advm", "0", "udc", "1"));
23782378
}else{
23792379
style_submenu_element("Advanced", "%s",
23802380
url_render(&url, "advm", "1", "udc", "1"));
23812381
}
23822382
--- src/timeline.c
+++ src/timeline.c
@@ -1187,11 +1187,11 @@
1187 case 'c': tmFlags = TIMELINE_COMPACT; break;
1188 case 'v': tmFlags = TIMELINE_VERBOSE; break;
1189 case 'j': tmFlags = TIMELINE_COLUMNAR; break;
1190 case 'x': tmFlags = TIMELINE_CLASSIC; break;
1191 default: tmFlags = TIMELINE_MODERN; break;
1192 }
1193 return tmFlags;
1194 }
1195
1196 /*
1197 ** Add the select/option box to the timeline submenu that is used to
@@ -1198,11 +1198,11 @@
1198 ** set the ss= parameter that determines the viewing mode.
1199 **
1200 ** Return the TIMELINE_* value appropriate for the view-style.
1201 */
1202 int timeline_ss_submenu(void){
1203 static const char *azViewStyles[] = {
1204 "m", "Modern View",
1205 "j", "Columnar View",
1206 "c", "Compact View",
1207 "v", "Verbose View",
1208 "x", "Classic View",
@@ -1627,11 +1627,11 @@
1627 z = "50";
1628 nEntry = 50;
1629 }
1630 cgi_replace_query_parameter("n",z);
1631 cookie_write_parameter("n","n",0);
1632 tmFlags |= timeline_ss_submenu();
1633 cookie_link_parameter("advm","advm","0");
1634 advancedMenu = atoi(PD("advm","0"));
1635
1636 /* Omit all cherry-pick merge lines if the "ncp" query parameter is
1637 ** present or if this repository lacks a "cherrypick" table. */
@@ -2036,11 +2036,11 @@
2036 if( z && z[0] ){
2037 zYearWeekStart = db_text(0, "SELECT date(%Q,'-6 days','weekday 1')",
2038 zYearWeek);
2039 zYearWeek = z;
2040 }else{
2041 if( strlen(zYearWeek)==7 ){
2042 zYearWeekStart = db_text(0,
2043 "SELECT date('%.4q-01-01','+%d days','weekday 1')",
2044 zYearWeek, atoi(zYearWeek+5)*7);
2045 }else{
2046 zYearWeekStart = 0;
@@ -2244,11 +2244,11 @@
2244 n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/");
2245 zPlural = n==1 ? "" : "s";
2246 if( zYearMonth ){
2247 blob_appendf(&desc, "%d %s%s for %h", n, zEType, zPlural, zYearMonth);
2248 }else if( zYearWeek ){
2249 blob_appendf(&desc, "%d %s%s for week %h beginning on %h",
2250 n, zEType, zPlural, zYearWeek, zYearWeekStart);
2251 }else if( zDay ){
2252 blob_appendf(&desc, "%d %s%s occurring on %h", n, zEType, zPlural, zDay);
2253 }else if( zNDays ){
2254 blob_appendf(&desc, "%d %s%s within the past %d day%s",
@@ -2371,11 +2371,11 @@
2371 }
2372 if( search_restrict(SRCH_CKIN)!=0 ){
2373 style_submenu_element("Search", "%R/search?y=c");
2374 }
2375 if( advancedMenu ){
2376 style_submenu_element("Basic", "%s",
2377 url_render(&url, "advm", "0", "udc", "1"));
2378 }else{
2379 style_submenu_element("Advanced", "%s",
2380 url_render(&url, "advm", "1", "udc", "1"));
2381 }
2382
--- src/timeline.c
+++ src/timeline.c
@@ -1187,11 +1187,11 @@
1187 case 'c': tmFlags = TIMELINE_COMPACT; break;
1188 case 'v': tmFlags = TIMELINE_VERBOSE; break;
1189 case 'j': tmFlags = TIMELINE_COLUMNAR; break;
1190 case 'x': tmFlags = TIMELINE_CLASSIC; break;
1191 default: tmFlags = TIMELINE_MODERN; break;
1192 }
1193 return tmFlags;
1194 }
1195
1196 /*
1197 ** Add the select/option box to the timeline submenu that is used to
@@ -1198,11 +1198,11 @@
1198 ** set the ss= parameter that determines the viewing mode.
1199 **
1200 ** Return the TIMELINE_* value appropriate for the view-style.
1201 */
1202 int timeline_ss_submenu(void){
1203 static const char *const azViewStyles[] = {
1204 "m", "Modern View",
1205 "j", "Columnar View",
1206 "c", "Compact View",
1207 "v", "Verbose View",
1208 "x", "Classic View",
@@ -1627,11 +1627,11 @@
1627 z = "50";
1628 nEntry = 50;
1629 }
1630 cgi_replace_query_parameter("n",z);
1631 cookie_write_parameter("n","n",0);
1632 tmFlags |= timeline_ss_submenu();
1633 cookie_link_parameter("advm","advm","0");
1634 advancedMenu = atoi(PD("advm","0"));
1635
1636 /* Omit all cherry-pick merge lines if the "ncp" query parameter is
1637 ** present or if this repository lacks a "cherrypick" table. */
@@ -2036,11 +2036,11 @@
2036 if( z && z[0] ){
2037 zYearWeekStart = db_text(0, "SELECT date(%Q,'-6 days','weekday 1')",
2038 zYearWeek);
2039 zYearWeek = z;
2040 }else{
2041 if( strlen(zYearWeek)==7 ){
2042 zYearWeekStart = db_text(0,
2043 "SELECT date('%.4q-01-01','+%d days','weekday 1')",
2044 zYearWeek, atoi(zYearWeek+5)*7);
2045 }else{
2046 zYearWeekStart = 0;
@@ -2244,11 +2244,11 @@
2244 n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/");
2245 zPlural = n==1 ? "" : "s";
2246 if( zYearMonth ){
2247 blob_appendf(&desc, "%d %s%s for %h", n, zEType, zPlural, zYearMonth);
2248 }else if( zYearWeek ){
2249 blob_appendf(&desc, "%d %s%s for week %h beginning on %h",
2250 n, zEType, zPlural, zYearWeek, zYearWeekStart);
2251 }else if( zDay ){
2252 blob_appendf(&desc, "%d %s%s occurring on %h", n, zEType, zPlural, zDay);
2253 }else if( zNDays ){
2254 blob_appendf(&desc, "%d %s%s within the past %d day%s",
@@ -2371,11 +2371,11 @@
2371 }
2372 if( search_restrict(SRCH_CKIN)!=0 ){
2373 style_submenu_element("Search", "%R/search?y=c");
2374 }
2375 if( advancedMenu ){
2376 style_submenu_element("Basic", "%s",
2377 url_render(&url, "advm", "0", "udc", "1"));
2378 }else{
2379 style_submenu_element("Advanced", "%s",
2380 url_render(&url, "advm", "1", "udc", "1"));
2381 }
2382
+7 -7
--- src/webmail.c
+++ src/webmail.c
@@ -120,11 +120,11 @@
120120
return i;
121121
}
122122
123123
/*
124124
** Look for a parameter of the form NAME=VALUE in the given email
125
-** header line. Return a copy of VALUE in space obtained from
125
+** header line. Return a copy of VALUE in space obtained from
126126
** fossil_malloc(). Or return NULL if there is no such parameter.
127127
*/
128128
static char *email_hdr_value(const char *z, const char *zName){
129129
int nName = (int)strlen(zName);
130130
int i;
@@ -358,11 +358,11 @@
358358
/*
359359
** Add the select/option box to the timeline submenu that shows
360360
** the various email message formats.
361361
*/
362362
static void webmail_f_submenu(void){
363
- static const char *az[] = {
363
+ static const char *const az[] = {
364364
"0", "Normal",
365365
"1", "Decoded",
366366
"2", "Raw",
367367
};
368368
style_submenu_multichoice("f", sizeof(az)/(2*sizeof(az[0])), az, 0);
@@ -371,11 +371,11 @@
371371
/*
372372
** If the first N characters of z[] are the name of a header field
373373
** that should be shown in "Normal" mode, then return 1.
374374
*/
375375
static int webmail_normal_header(const char *z, int N){
376
- static const char *az[] = {
376
+ static const char *const az[] = {
377377
"To", "Cc", "Bcc", "Date", "From", "Subject",
378378
};
379379
int i;
380380
for(i=0; i<sizeof(az)/sizeof(az[0]); i++){
381381
if( sqlite3_strnicmp(z, az[i], N)==0 ) return 1;
@@ -415,11 +415,11 @@
415415
int eFormat = atoi(PD("f","0"));
416416
eState = db_column_int(&q, 1);
417417
eTranscript = db_column_int(&q, 2);
418418
if( eFormat==2 ){
419419
@ <pre>%h(db_column_text(&q, 0))</pre>
420
- }else{
420
+ }else{
421421
EmailToc *p = emailtoc_from_email(&msg);
422422
int i, j;
423423
@ <p>
424424
for(i=0; i<p->nHdr; i++){
425425
char *z = p->azHdr[i];
@@ -563,11 +563,11 @@
563563
/*
564564
** Add the select/option box to the timeline submenu that shows
565565
** which messages to include in the index.
566566
*/
567567
static void webmail_d_submenu(void){
568
- static const char *az[] = {
568
+ static const char *const az[] = {
569569
"0", "InBox",
570570
"1", "Unread",
571571
"2", "Trash",
572572
"3", "Sent",
573573
"4", "Everything",
@@ -590,11 +590,11 @@
590590
** d=N 0: inbox+unread 1: unread-only 2: trash 3: all
591591
** eN Select email entry emailbox.ebid==N
592592
** trash Move selected entries to trash (estate=2)
593593
** read Mark selected entries as read (estate=1)
594594
** unread Mark selected entries as unread (estate=0)
595
-**
595
+**
596596
*/
597597
void webmail_page(void){
598598
int emailid;
599599
Stmt q;
600600
Blob sql;
@@ -769,11 +769,11 @@
769769
** This page, accessible only to administrators, allows easy viewing of
770770
** the emailblob table - the table that contains the text of email messages
771771
** both inbound and outbound, and transcripts of SMTP sessions.
772772
**
773773
** id=N Show the text of emailblob with emailid==N
774
-**
774
+**
775775
*/
776776
void webmail_emailblob_page(void){
777777
int id = atoi(PD("id","0"));
778778
Stmt q;
779779
login_check_credentials();
780780
--- src/webmail.c
+++ src/webmail.c
@@ -120,11 +120,11 @@
120 return i;
121 }
122
123 /*
124 ** Look for a parameter of the form NAME=VALUE in the given email
125 ** header line. Return a copy of VALUE in space obtained from
126 ** fossil_malloc(). Or return NULL if there is no such parameter.
127 */
128 static char *email_hdr_value(const char *z, const char *zName){
129 int nName = (int)strlen(zName);
130 int i;
@@ -358,11 +358,11 @@
358 /*
359 ** Add the select/option box to the timeline submenu that shows
360 ** the various email message formats.
361 */
362 static void webmail_f_submenu(void){
363 static const char *az[] = {
364 "0", "Normal",
365 "1", "Decoded",
366 "2", "Raw",
367 };
368 style_submenu_multichoice("f", sizeof(az)/(2*sizeof(az[0])), az, 0);
@@ -371,11 +371,11 @@
371 /*
372 ** If the first N characters of z[] are the name of a header field
373 ** that should be shown in "Normal" mode, then return 1.
374 */
375 static int webmail_normal_header(const char *z, int N){
376 static const char *az[] = {
377 "To", "Cc", "Bcc", "Date", "From", "Subject",
378 };
379 int i;
380 for(i=0; i<sizeof(az)/sizeof(az[0]); i++){
381 if( sqlite3_strnicmp(z, az[i], N)==0 ) return 1;
@@ -415,11 +415,11 @@
415 int eFormat = atoi(PD("f","0"));
416 eState = db_column_int(&q, 1);
417 eTranscript = db_column_int(&q, 2);
418 if( eFormat==2 ){
419 @ <pre>%h(db_column_text(&q, 0))</pre>
420 }else{
421 EmailToc *p = emailtoc_from_email(&msg);
422 int i, j;
423 @ <p>
424 for(i=0; i<p->nHdr; i++){
425 char *z = p->azHdr[i];
@@ -563,11 +563,11 @@
563 /*
564 ** Add the select/option box to the timeline submenu that shows
565 ** which messages to include in the index.
566 */
567 static void webmail_d_submenu(void){
568 static const char *az[] = {
569 "0", "InBox",
570 "1", "Unread",
571 "2", "Trash",
572 "3", "Sent",
573 "4", "Everything",
@@ -590,11 +590,11 @@
590 ** d=N 0: inbox+unread 1: unread-only 2: trash 3: all
591 ** eN Select email entry emailbox.ebid==N
592 ** trash Move selected entries to trash (estate=2)
593 ** read Mark selected entries as read (estate=1)
594 ** unread Mark selected entries as unread (estate=0)
595 **
596 */
597 void webmail_page(void){
598 int emailid;
599 Stmt q;
600 Blob sql;
@@ -769,11 +769,11 @@
769 ** This page, accessible only to administrators, allows easy viewing of
770 ** the emailblob table - the table that contains the text of email messages
771 ** both inbound and outbound, and transcripts of SMTP sessions.
772 **
773 ** id=N Show the text of emailblob with emailid==N
774 **
775 */
776 void webmail_emailblob_page(void){
777 int id = atoi(PD("id","0"));
778 Stmt q;
779 login_check_credentials();
780
--- src/webmail.c
+++ src/webmail.c
@@ -120,11 +120,11 @@
120 return i;
121 }
122
123 /*
124 ** Look for a parameter of the form NAME=VALUE in the given email
125 ** header line. Return a copy of VALUE in space obtained from
126 ** fossil_malloc(). Or return NULL if there is no such parameter.
127 */
128 static char *email_hdr_value(const char *z, const char *zName){
129 int nName = (int)strlen(zName);
130 int i;
@@ -358,11 +358,11 @@
358 /*
359 ** Add the select/option box to the timeline submenu that shows
360 ** the various email message formats.
361 */
362 static void webmail_f_submenu(void){
363 static const char *const az[] = {
364 "0", "Normal",
365 "1", "Decoded",
366 "2", "Raw",
367 };
368 style_submenu_multichoice("f", sizeof(az)/(2*sizeof(az[0])), az, 0);
@@ -371,11 +371,11 @@
371 /*
372 ** If the first N characters of z[] are the name of a header field
373 ** that should be shown in "Normal" mode, then return 1.
374 */
375 static int webmail_normal_header(const char *z, int N){
376 static const char *const az[] = {
377 "To", "Cc", "Bcc", "Date", "From", "Subject",
378 };
379 int i;
380 for(i=0; i<sizeof(az)/sizeof(az[0]); i++){
381 if( sqlite3_strnicmp(z, az[i], N)==0 ) return 1;
@@ -415,11 +415,11 @@
415 int eFormat = atoi(PD("f","0"));
416 eState = db_column_int(&q, 1);
417 eTranscript = db_column_int(&q, 2);
418 if( eFormat==2 ){
419 @ <pre>%h(db_column_text(&q, 0))</pre>
420 }else{
421 EmailToc *p = emailtoc_from_email(&msg);
422 int i, j;
423 @ <p>
424 for(i=0; i<p->nHdr; i++){
425 char *z = p->azHdr[i];
@@ -563,11 +563,11 @@
563 /*
564 ** Add the select/option box to the timeline submenu that shows
565 ** which messages to include in the index.
566 */
567 static void webmail_d_submenu(void){
568 static const char *const az[] = {
569 "0", "InBox",
570 "1", "Unread",
571 "2", "Trash",
572 "3", "Sent",
573 "4", "Everything",
@@ -590,11 +590,11 @@
590 ** d=N 0: inbox+unread 1: unread-only 2: trash 3: all
591 ** eN Select email entry emailbox.ebid==N
592 ** trash Move selected entries to trash (estate=2)
593 ** read Mark selected entries as read (estate=1)
594 ** unread Mark selected entries as unread (estate=0)
595 **
596 */
597 void webmail_page(void){
598 int emailid;
599 Stmt q;
600 Blob sql;
@@ -769,11 +769,11 @@
769 ** This page, accessible only to administrators, allows easy viewing of
770 ** the emailblob table - the table that contains the text of email messages
771 ** both inbound and outbound, and transcripts of SMTP sessions.
772 **
773 ** id=N Show the text of emailblob with emailid==N
774 **
775 */
776 void webmail_emailblob_page(void){
777 int id = atoi(PD("id","0"));
778 Stmt q;
779 login_check_credentials();
780

Keyboard Shortcuts

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