Fossil SCM
Code cleanup: Add a lot of "const" qualifiers for static (string) arrays, where appropriate. This allows the C compiler to optimize more
Commit
70a94d09720fc8a03aa7a02713c6804734c42f5dd21c25fc09c56a9d75f7a919
Parent
0fd6cf166ce5d9c…
15 files changed
+3
-3
+3
-3
+4
-4
+3
-3
+1
-1
+1
-1
+1
-1
+1
-1
+2
-2
+5
-5
+1
-1
+5
-5
+10
-10
+6
-6
+7
-7
+3
-3
| --- src/capabilities.c | ||
| +++ src/capabilities.c | ||
| @@ -91,11 +91,11 @@ | ||
| 91 | 91 | void capability_free(CapabilityString *p){ |
| 92 | 92 | fossil_free(p); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /* |
| 96 | -** Expand the capability string by including all capabilities for | |
| 96 | +** Expand the capability string by including all capabilities for | |
| 97 | 97 | ** special users "nobody" and "anonymous". Also include "reader" |
| 98 | 98 | ** if "u" is present and "developer" if "v" is present. |
| 99 | 99 | */ |
| 100 | 100 | void capability_expand(CapabilityString *pIn){ |
| 101 | 101 | static char *zNobody = 0; |
| @@ -379,12 +379,12 @@ | ||
| 379 | 379 | while( db_step(&q)==SQLITE_ROW ){ |
| 380 | 380 | const char *zId = db_column_text(&q, 0); |
| 381 | 381 | const char *zCap = db_column_text(&q, 1); |
| 382 | 382 | int n = db_column_int(&q, 3); |
| 383 | 383 | 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" }; | |
| 386 | 386 | |
| 387 | 387 | if( n==0 ) continue; |
| 388 | 388 | |
| 389 | 389 | /* Code */ |
| 390 | 390 | if( db_column_int(&q,2)<10 ){ |
| 391 | 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 *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 @@ | ||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /* |
| 165 | 165 | ** Additional information used to form the HTTP reply |
| 166 | 166 | */ |
| 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 */ | |
| 169 | 169 | static int iReplyStatus = 200; /* Reply status code */ |
| 170 | 170 | static Blob extraHeader = BLOB_INITIALIZER; /* Extra header text */ |
| 171 | 171 | |
| 172 | 172 | /* |
| 173 | 173 | ** Set the reply content type |
| @@ -1943,11 +1943,11 @@ | ||
| 1943 | 1943 | fprintf(stderr, "/***** Child %d exited on signal %d (%s) *****/\n", |
| 1944 | 1944 | x, WTERMSIG(iStatus), strsignal(WTERMSIG(iStatus))); |
| 1945 | 1945 | } |
| 1946 | 1946 | nchildren--; |
| 1947 | 1947 | } |
| 1948 | - } | |
| 1948 | + } | |
| 1949 | 1949 | } |
| 1950 | 1950 | /* NOT REACHED */ |
| 1951 | 1951 | fossil_exit(1); |
| 1952 | 1952 | #endif |
| 1953 | 1953 | /* NOT REACHED */ |
| 1954 | 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 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 @@ | ||
| 175 | 175 | int iNext; /* Next cursor value */ |
| 176 | 176 | }; |
| 177 | 177 | |
| 178 | 178 | /* Operator names: |
| 179 | 179 | */ |
| 180 | -static const char *azOp[] = { | |
| 180 | +static const char *const azOp[] = { | |
| 181 | 181 | "SIZE", "COPY", "INSERT", "CHECKSUM", "ERROR", "EOF" |
| 182 | 182 | }; |
| 183 | 183 | #define DELTAPARSE_OP_SIZE 0 |
| 184 | 184 | #define DELTAPARSE_OP_COPY 1 |
| 185 | 185 | #define DELTAPARSE_OP_INSERT 2 |
| @@ -389,15 +389,15 @@ | ||
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | /* |
| 392 | 392 | ** This method is called to "rewind" the deltaparsevtab_cursor object back |
| 393 | 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 | |
| 394 | +** once prior to any call to deltaparsevtabColumn() or deltaparsevtabRowid() or | |
| 395 | 395 | ** deltaparsevtabEof(). |
| 396 | 396 | */ |
| 397 | 397 | static int deltaparsevtabFilter( |
| 398 | - sqlite3_vtab_cursor *pVtabCursor, | |
| 398 | + sqlite3_vtab_cursor *pVtabCursor, | |
| 399 | 399 | int idxNum, const char *idxStr, |
| 400 | 400 | int argc, sqlite3_value **argv |
| 401 | 401 | ){ |
| 402 | 402 | deltaparsevtab_cursor *pCur = (deltaparsevtab_cursor *)pVtabCursor; |
| 403 | 403 | const char *a; |
| @@ -459,11 +459,11 @@ | ||
| 459 | 459 | pIdxInfo->estimatedRows = 0x7fffffff; |
| 460 | 460 | return SQLITE_CONSTRAINT; |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | /* |
| 464 | -** This following structure defines all the methods for the | |
| 464 | +** This following structure defines all the methods for the | |
| 465 | 465 | ** virtual table. |
| 466 | 466 | */ |
| 467 | 467 | static sqlite3_module deltaparsevtabModule = { |
| 468 | 468 | /* iVersion */ 0, |
| 469 | 469 | /* xCreate */ 0, |
| 470 | 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 *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 @@ | ||
| 1745 | 1745 | ** Return non-NULL if zFilename contains pathname elements that |
| 1746 | 1746 | ** are reserved on Windows. The returned string is the disallowed |
| 1747 | 1747 | ** path element. |
| 1748 | 1748 | */ |
| 1749 | 1749 | 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" }; | |
| 1751 | 1751 | static char zReturn[5]; |
| 1752 | 1752 | int i; |
| 1753 | 1753 | while( zPath[0] ){ |
| 1754 | 1754 | for(i=0; i<count(azRes); i++){ |
| 1755 | 1755 | if( sqlite3_strnicmp(zPath, azRes[i], 3)==0 |
| @@ -1978,11 +1978,11 @@ | ||
| 1978 | 1978 | ** impossible for fossil to choose between multiple potential |
| 1979 | 1979 | ** timestamps. A non-fatal warning is emitted for such cases. |
| 1980 | 1980 | ** |
| 1981 | 1981 | */ |
| 1982 | 1982 | void touch_cmd(){ |
| 1983 | - const char * zGlobList; /* -g List of glob patterns */ | |
| 1983 | + const char * zGlobList; /* -g List of glob patterns */ | |
| 1984 | 1984 | const char * zGlobFile; /* -G File of glob patterns */ |
| 1985 | 1985 | Glob * pGlob = 0; /* List of glob patterns */ |
| 1986 | 1986 | int verboseFlag; |
| 1987 | 1987 | int dryRunFlag; |
| 1988 | 1988 | int vid; /* Checkout version */ |
| @@ -2145,11 +2145,11 @@ | ||
| 2145 | 2145 | assert(newMtime>0); |
| 2146 | 2146 | } |
| 2147 | 2147 | changeCount += |
| 2148 | 2148 | touch_cmd_stamp_one_file( zAbs, zArg, newMtime, dryRunFlag, |
| 2149 | 2149 | verboseFlag, quietFlag ); |
| 2150 | - } | |
| 2150 | + } | |
| 2151 | 2151 | } |
| 2152 | 2152 | db_end_transaction(0); |
| 2153 | 2153 | blob_reset(&absBuffer); |
| 2154 | 2154 | if( dryRunFlag!=0 ){ |
| 2155 | 2155 | fossil_print("dry-run: would have touched %d file(s)\n", |
| 2156 | 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 *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 @@ | ||
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | /* |
| 219 | 219 | ** Names of the hash policies. |
| 220 | 220 | */ |
| 221 | -static const char *azPolicy[] = { | |
| 221 | +static const char *const azPolicy[] = { | |
| 222 | 222 | "sha1", "auto", "sha3", "sha3-only", "shun-sha1" |
| 223 | 223 | }; |
| 224 | 224 | |
| 225 | 225 | /* Return the name of the current hash policy. |
| 226 | 226 | */ |
| 227 | 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 *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 |
+1
-1
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -80,11 +80,11 @@ | ||
| 80 | 80 | ** Check zFossil to see if it is a reasonable "fossil" command to |
| 81 | 81 | ** run on the server. Do not allow an attacker to substitute something |
| 82 | 82 | ** like "/bin/rm". |
| 83 | 83 | */ |
| 84 | 84 | static int is_safe_fossil_command(const char *zFossil){ |
| 85 | - static const char *azSafe[] = { "*/fossil", "*/echo" }; | |
| 85 | + static const char *const azSafe[] = { "*/fossil", "*/echo" }; | |
| 86 | 86 | int i; |
| 87 | 87 | for(i=0; i<sizeof(azSafe)/sizeof(azSafe[0]); i++){ |
| 88 | 88 | if( sqlite3_strglob(azSafe[i], zFossil)==0 ) return 1; |
| 89 | 89 | if( strcmp(azSafe[i]+2, zFossil)==0 ) return 1; |
| 90 | 90 | } |
| 91 | 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 *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 @@ | ||
| 140 | 140 | }; |
| 141 | 141 | |
| 142 | 142 | /* |
| 143 | 143 | ** Names of manifest types |
| 144 | 144 | */ |
| 145 | -static const char *azNameOfMType[] = { | |
| 145 | +static const char *const azNameOfMType[] = { | |
| 146 | 146 | "manifest", |
| 147 | 147 | "cluster", |
| 148 | 148 | "tag", |
| 149 | 149 | "wiki", |
| 150 | 150 | "ticket", |
| 151 | 151 |
| --- 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 @@ | ||
| 1342 | 1342 | return mz_inflateEnd(&stream); |
| 1343 | 1343 | } |
| 1344 | 1344 | |
| 1345 | 1345 | const char *mz_error(int err) |
| 1346 | 1346 | { |
| 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[] = | |
| 1348 | 1348 | { |
| 1349 | 1349 | { MZ_OK, "" }, { MZ_STREAM_END, "stream end" }, { MZ_NEED_DICT, "need dictionary" }, { MZ_ERRNO, "file error" }, { MZ_STREAM_ERROR, "stream error" }, |
| 1350 | 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 | 1351 | }; |
| 1352 | 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 | 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 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 @@ | ||
| 1110 | 1110 | }else{ |
| 1111 | 1111 | @ <div class='searchForm'> |
| 1112 | 1112 | } |
| 1113 | 1113 | @ <input type="text" name="s" size="40" value="%h(zPattern)"%s(zDisable1)> |
| 1114 | 1114 | 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[] = { | |
| 1116 | 1116 | { "all", "All", SRCH_ALL }, |
| 1117 | 1117 | { "c", "Check-ins", SRCH_CKIN }, |
| 1118 | 1118 | { "d", "Docs", SRCH_DOC }, |
| 1119 | 1119 | { "t", "Tickets", SRCH_TKT }, |
| 1120 | 1120 | { "w", "Wiki", SRCH_WIKI }, |
| @@ -1842,11 +1842,11 @@ | ||
| 1842 | 1842 | { 2, "index" }, |
| 1843 | 1843 | { 3, "disable" }, |
| 1844 | 1844 | { 4, "enable" }, |
| 1845 | 1845 | { 5, "stemmer" }, |
| 1846 | 1846 | }; |
| 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[] = { | |
| 1848 | 1848 | { "search-ci", "check-in search:", "c" }, |
| 1849 | 1849 | { "search-doc", "document search:", "d" }, |
| 1850 | 1850 | { "search-tkt", "ticket search:", "t" }, |
| 1851 | 1851 | { "search-wiki", "wiki search:", "w" }, |
| 1852 | 1852 | { "search-technote", "tech note search:", "e" }, |
| 1853 | 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 { 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 @@ | ||
| 312 | 312 | ** WEBPAGE: setup_access |
| 313 | 313 | ** |
| 314 | 314 | ** The access-control settings page. Requires Setup privileges. |
| 315 | 315 | */ |
| 316 | 316 | void setup_access(void){ |
| 317 | - static const char * const azRedirectOpts[] = { | |
| 317 | + static const char *const azRedirectOpts[] = { | |
| 318 | 318 | "0", "Off", |
| 319 | 319 | "1", "Login Page Only", |
| 320 | 320 | "2", "All Pages" |
| 321 | 321 | }; |
| 322 | 322 | login_check_credentials(); |
| @@ -332,11 +332,11 @@ | ||
| 332 | 332 | @ <input type="submit" name="submit" value="Apply Changes" /></p> |
| 333 | 333 | @ <hr /> |
| 334 | 334 | multiple_choice_attribute("Redirect to HTTPS", |
| 335 | 335 | "redirect-to-https", "redirhttps", "0", |
| 336 | 336 | 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 | |
| 338 | 338 | @ unencrypted request is received. This feature can be enabled |
| 339 | 339 | @ for the Login page only, or for all pages. |
| 340 | 340 | @ <p>Further details: When enabled, this option causes the $secureurl TH1 |
| 341 | 341 | @ variable is set to an "https:" variant of $baseurl. Otherwise, |
| 342 | 342 | @ $secureurl is just an alias for $baseurl. |
| @@ -916,11 +916,11 @@ | ||
| 916 | 916 | @ If no tarball prefix is specified, then the full Project Name above is used. |
| 917 | 917 | @ (Property: "short-project-name") |
| 918 | 918 | @ </p> |
| 919 | 919 | @ <hr /> |
| 920 | 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 | |
| 921 | + @ <p>The <a href='%R/download'>/download</a> page is designed to provide | |
| 922 | 922 | @ a convenient place for newbies |
| 923 | 923 | @ to download a ZIP archive or a tarball of the project. By default, |
| 924 | 924 | @ the latest trunk check-in is downloaded. Change this tag to something |
| 925 | 925 | @ else (ex: release) to alter the behavior of the /download page. |
| 926 | 926 | @ (Property: "download-tag") |
| @@ -947,12 +947,12 @@ | ||
| 947 | 947 | @ "<b>/home</b>" will work but "<b>home</b>" will not, since it omits the |
| 948 | 948 | @ leading "/".</p> |
| 949 | 949 | @ <p>(Property: "index-page") |
| 950 | 950 | @ <hr> |
| 951 | 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 | |
| 952 | + @ Often these are filled in with links like | |
| 953 | + @ "/doc/trunk/doc/<i>filename</i>.md" so that they refer to | |
| 954 | 954 | @ embedded documentation, or like "/wiki/<i>pagename</i>" to refer |
| 955 | 955 | @ to wiki pages. |
| 956 | 956 | @ Leave blank to omit. |
| 957 | 957 | @ <p> |
| 958 | 958 | entry_attribute("Documentation Index", 40, "sitemap-docidx", "smdocidx", |
| 959 | 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 |
| --- 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 @@ | ||
| 381 | 381 | const char *zUser = db_column_text(&q, 1); |
| 382 | 382 | const char *zDate = db_column_text(&q, 2); |
| 383 | 383 | const char *zIpAddr = db_column_text(&q, 3); |
| 384 | 384 | int usesSha1 = db_column_int(&q, 5)!=0; |
| 385 | 385 | 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" }; | |
| 387 | 387 | const char *zHash = zHashType[usesSha1+usesSha3*2]; |
| 388 | 388 | if( cnt==perScreen && !showAll ){ |
| 389 | 389 | style_submenu_element("Older", "rcvfromlist?ofst=%d", ofst+perScreen); |
| 390 | 390 | }else{ |
| 391 | 391 | cnt++; |
| 392 | 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 *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 @@ | ||
| 57 | 57 | }; |
| 58 | 58 | |
| 59 | 59 | /* |
| 60 | 60 | ** A skin consists of five "files" named here: |
| 61 | 61 | */ |
| 62 | -static const char *azSkinFile[] = { | |
| 62 | +static const char *const azSkinFile[] = { | |
| 63 | 63 | "css", "header", "footer", "details", "js" |
| 64 | 64 | }; |
| 65 | 65 | |
| 66 | 66 | /* |
| 67 | 67 | ** Alternative skins can be specified in the CGI script or by options |
| @@ -498,15 +498,15 @@ | ||
| 498 | 498 | } |
| 499 | 499 | if( skinRename() || skinSave(zCurrent) ){ |
| 500 | 500 | db_end_transaction(0); |
| 501 | 501 | return; |
| 502 | 502 | } |
| 503 | - | |
| 503 | + | |
| 504 | 504 | /* The user pressed one of the "Install" buttons. */ |
| 505 | 505 | if( P("load") && (z = P("sn"))!=0 && z[0] ){ |
| 506 | 506 | int seen = 0; |
| 507 | - | |
| 507 | + | |
| 508 | 508 | /* Check to see if the current skin is already saved. If it is, there |
| 509 | 509 | ** is no need to create a backup */ |
| 510 | 510 | zCurrent = getSkin(0); |
| 511 | 511 | for(i=0; i<count(aBuiltinSkin); i++){ |
| 512 | 512 | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ |
| @@ -539,11 +539,11 @@ | ||
| 539 | 539 | zCurrent = db_get(zName, 0); |
| 540 | 540 | db_multi_exec("%s", zCurrent/*safe-for-%s*/); |
| 541 | 541 | } |
| 542 | 542 | } |
| 543 | 543 | } |
| 544 | - | |
| 544 | + | |
| 545 | 545 | style_header("Skins"); |
| 546 | 546 | if( zErr ){ |
| 547 | 547 | @ <p style="color:red">%h(zErr)</p> |
| 548 | 548 | } |
| 549 | 549 | @ <table border="0"> |
| @@ -881,11 +881,11 @@ | ||
| 881 | 881 | int iSkin; /* Which draft skin is being edited */ |
| 882 | 882 | int isSetup; /* True for an administrator */ |
| 883 | 883 | int isEditor; /* Others authorized to make edits */ |
| 884 | 884 | char *zAllowedEditors; /* Who may edit the draft skin */ |
| 885 | 885 | char *zBase; /* Base URL for draft under test */ |
| 886 | - static const char *azTestPages[] = { | |
| 886 | + static const char *const azTestPages[] = { | |
| 887 | 887 | "home", |
| 888 | 888 | "timeline", |
| 889 | 889 | "dir?ci=tip", |
| 890 | 890 | "dir?ci=tip&type=tree", |
| 891 | 891 | "brlist", |
| 892 | 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 *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 @@ | ||
| 116 | 116 | pBest = p->Data.MX.pNameExchange; |
| 117 | 117 | } |
| 118 | 118 | p = p->pNext; |
| 119 | 119 | } |
| 120 | 120 | if( pBest ){ |
| 121 | - pBest = fossil_strdup(pBest); | |
| 121 | + pBest = fossil_strdup(pBest); | |
| 122 | 122 | } |
| 123 | 123 | DnsRecordListFree(pDnsRecord, DnsFreeRecordListDeep); |
| 124 | 124 | return pBest; |
| 125 | 125 | #else |
| 126 | 126 | return 0; |
| @@ -646,11 +646,11 @@ | ||
| 646 | 646 | *****************************************************************************/ |
| 647 | 647 | |
| 648 | 648 | /* |
| 649 | 649 | ** Schema used by the email processing system. |
| 650 | 650 | */ |
| 651 | -static const char zEmailSchema[] = | |
| 651 | +static const char zEmailSchema[] = | |
| 652 | 652 | @ -- bulk storage is in this table. This table can store either |
| 653 | 653 | @ -- the body of email messages or transcripts of an smtp session. |
| 654 | 654 | @ CREATE TABLE IF NOT EXISTS repository.emailblob( |
| 655 | 655 | @ emailid INTEGER PRIMARY KEY AUTOINCREMENT, -- numeric idea for the entry |
| 656 | 656 | @ enref INT, -- Number of references to this blob |
| @@ -903,21 +903,21 @@ | ||
| 903 | 903 | @ <input type="submit" name="cancel" value="Cancel"> |
| 904 | 904 | @ </tr> |
| 905 | 905 | @ </table> |
| 906 | 906 | @ <hr> |
| 907 | 907 | @ <h1>Instructions</h1> |
| 908 | - @ | |
| 908 | + @ | |
| 909 | 909 | @ <p>The "Routing" field consists of zero or more lines where each |
| 910 | 910 | @ line is an "action" followed by an "argument". Available actions: |
| 911 | 911 | @ <ul> |
| 912 | 912 | @ <li><p><b>forward</b> <i>email-address</i> |
| 913 | 913 | @ <p>Forward the message to <i>email-address</i>. |
| 914 | 914 | @ <li><p><b>mbox</b> <i>login-name</i> |
| 915 | 915 | @ <p>Store the message in the local mailbox for the user |
| 916 | 916 | @ with USER.LOGIN=<i>login-name</i>. |
| 917 | 917 | @ </ul> |
| 918 | - @ | |
| 918 | + @ | |
| 919 | 919 | @ <p>To delete a route → erase all text from the "Routing" field then |
| 920 | 920 | @ press the "Apply" button. |
| 921 | 921 | style_footer(); |
| 922 | 922 | } |
| 923 | 923 | |
| @@ -951,11 +951,11 @@ | ||
| 951 | 951 | |
| 952 | 952 | #endif /* LOCAL_INTERFACE */ |
| 953 | 953 | |
| 954 | 954 | /* |
| 955 | 955 | ** Clear the SmtpServer object. Deallocate resources. |
| 956 | -** How much to clear depends on eHowMuch | |
| 956 | +** How much to clear depends on eHowMuch | |
| 957 | 957 | */ |
| 958 | 958 | static void smtp_server_clear(SmtpServer *p, int eHowMuch){ |
| 959 | 959 | int i; |
| 960 | 960 | if( eHowMuch>=SMTPSRV_CLEAR_MSG ){ |
| 961 | 961 | fossil_free(p->zFrom); |
| @@ -1095,11 +1095,11 @@ | ||
| 1095 | 1095 | int okRemote /* True if ok to foward to another domain */ |
| 1096 | 1096 | ){ |
| 1097 | 1097 | char *zPolicy; |
| 1098 | 1098 | Blob policy, line, token, tail; |
| 1099 | 1099 | |
| 1100 | - zPolicy = db_text(0, | |
| 1100 | + zPolicy = db_text(0, | |
| 1101 | 1101 | "SELECT epolicy FROM emailroute WHERE eaddr=%Q", zAddr); |
| 1102 | 1102 | if( zPolicy==0 ){ |
| 1103 | 1103 | if( okRemote ){ |
| 1104 | 1104 | int i; |
| 1105 | 1105 | for(i=0; zAddr[i] && zAddr[i]!='@'; i++){} |
| @@ -1204,11 +1204,11 @@ | ||
| 1204 | 1204 | } |
| 1205 | 1205 | |
| 1206 | 1206 | /* Fix up the emailblob.enref field of the email message body */ |
| 1207 | 1207 | if( p->nRef ){ |
| 1208 | 1208 | db_multi_exec( |
| 1209 | - "UPDATE emailblob SET enref=%d WHERE emailid=%lld", | |
| 1209 | + "UPDATE emailblob SET enref=%d WHERE emailid=%lld", | |
| 1210 | 1210 | p->nRef, p->idMsg |
| 1211 | 1211 | ); |
| 1212 | 1212 | }else{ |
| 1213 | 1213 | db_multi_exec( |
| 1214 | 1214 | "DELETE FROM emailblob WHERE emailid=%lld", p->idMsg |
| @@ -1286,11 +1286,11 @@ | ||
| 1286 | 1286 | if( doClean ){ |
| 1287 | 1287 | smtp_cleanup(); |
| 1288 | 1288 | } |
| 1289 | 1289 | } |
| 1290 | 1290 | blob_init(&sql, 0, 0); |
| 1291 | - blob_append_sql(&sql, | |
| 1291 | + blob_append_sql(&sql, | |
| 1292 | 1292 | "SELECT a.emailid, a.enref, b.n" |
| 1293 | 1293 | " FROM emailblob AS a JOIN refcnt AS b ON a.emailid=b.id" |
| 1294 | 1294 | ); |
| 1295 | 1295 | if( !fullReport ){ |
| 1296 | 1296 | blob_append_sql(&sql, " WHERE a.enref!=b.n"); |
| @@ -1514,11 +1514,11 @@ | ||
| 1514 | 1514 | } |
| 1515 | 1515 | pop3_print(pLog, "+OK"); |
| 1516 | 1516 | break; |
| 1517 | 1517 | } |
| 1518 | 1518 | if( strcmp(zCmd,"capa")==0 ){ |
| 1519 | - static const char *azCap[] = { | |
| 1519 | + static const char *const azCap[] = { | |
| 1520 | 1520 | "TOP", "USER", "UIDL", |
| 1521 | 1521 | }; |
| 1522 | 1522 | int i; |
| 1523 | 1523 | pop3_print(pLog, "+OK"); |
| 1524 | 1524 | for(i=0; i<sizeof(azCap)/sizeof(azCap[0]); i++){ |
| @@ -1552,11 +1552,11 @@ | ||
| 1552 | 1552 | " WHERE emailid=emsgid AND euser=%Q AND estate<=1" |
| 1553 | 1553 | " ORDER BY edate;", |
| 1554 | 1554 | zUser |
| 1555 | 1555 | ); |
| 1556 | 1556 | goto cmd_ok; |
| 1557 | - } | |
| 1557 | + } | |
| 1558 | 1558 | } |
| 1559 | 1559 | /* Fossil cannot process APOP since the users clear-text password is |
| 1560 | 1560 | ** unknown. */ |
| 1561 | 1561 | goto cmd_error; |
| 1562 | 1562 | }else{ |
| 1563 | 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 → 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 → 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 @@ | ||
| 1187 | 1187 | case 'c': tmFlags = TIMELINE_COMPACT; break; |
| 1188 | 1188 | case 'v': tmFlags = TIMELINE_VERBOSE; break; |
| 1189 | 1189 | case 'j': tmFlags = TIMELINE_COLUMNAR; break; |
| 1190 | 1190 | case 'x': tmFlags = TIMELINE_CLASSIC; break; |
| 1191 | 1191 | default: tmFlags = TIMELINE_MODERN; break; |
| 1192 | - } | |
| 1192 | + } | |
| 1193 | 1193 | return tmFlags; |
| 1194 | 1194 | } |
| 1195 | 1195 | |
| 1196 | 1196 | /* |
| 1197 | 1197 | ** Add the select/option box to the timeline submenu that is used to |
| @@ -1198,11 +1198,11 @@ | ||
| 1198 | 1198 | ** set the ss= parameter that determines the viewing mode. |
| 1199 | 1199 | ** |
| 1200 | 1200 | ** Return the TIMELINE_* value appropriate for the view-style. |
| 1201 | 1201 | */ |
| 1202 | 1202 | int timeline_ss_submenu(void){ |
| 1203 | - static const char *azViewStyles[] = { | |
| 1203 | + static const char *const azViewStyles[] = { | |
| 1204 | 1204 | "m", "Modern View", |
| 1205 | 1205 | "j", "Columnar View", |
| 1206 | 1206 | "c", "Compact View", |
| 1207 | 1207 | "v", "Verbose View", |
| 1208 | 1208 | "x", "Classic View", |
| @@ -1627,11 +1627,11 @@ | ||
| 1627 | 1627 | z = "50"; |
| 1628 | 1628 | nEntry = 50; |
| 1629 | 1629 | } |
| 1630 | 1630 | cgi_replace_query_parameter("n",z); |
| 1631 | 1631 | cookie_write_parameter("n","n",0); |
| 1632 | - tmFlags |= timeline_ss_submenu(); | |
| 1632 | + tmFlags |= timeline_ss_submenu(); | |
| 1633 | 1633 | cookie_link_parameter("advm","advm","0"); |
| 1634 | 1634 | advancedMenu = atoi(PD("advm","0")); |
| 1635 | 1635 | |
| 1636 | 1636 | /* Omit all cherry-pick merge lines if the "ncp" query parameter is |
| 1637 | 1637 | ** present or if this repository lacks a "cherrypick" table. */ |
| @@ -2036,11 +2036,11 @@ | ||
| 2036 | 2036 | if( z && z[0] ){ |
| 2037 | 2037 | zYearWeekStart = db_text(0, "SELECT date(%Q,'-6 days','weekday 1')", |
| 2038 | 2038 | zYearWeek); |
| 2039 | 2039 | zYearWeek = z; |
| 2040 | 2040 | }else{ |
| 2041 | - if( strlen(zYearWeek)==7 ){ | |
| 2041 | + if( strlen(zYearWeek)==7 ){ | |
| 2042 | 2042 | zYearWeekStart = db_text(0, |
| 2043 | 2043 | "SELECT date('%.4q-01-01','+%d days','weekday 1')", |
| 2044 | 2044 | zYearWeek, atoi(zYearWeek+5)*7); |
| 2045 | 2045 | }else{ |
| 2046 | 2046 | zYearWeekStart = 0; |
| @@ -2244,11 +2244,11 @@ | ||
| 2244 | 2244 | n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/"); |
| 2245 | 2245 | zPlural = n==1 ? "" : "s"; |
| 2246 | 2246 | if( zYearMonth ){ |
| 2247 | 2247 | blob_appendf(&desc, "%d %s%s for %h", n, zEType, zPlural, zYearMonth); |
| 2248 | 2248 | }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", | |
| 2250 | 2250 | n, zEType, zPlural, zYearWeek, zYearWeekStart); |
| 2251 | 2251 | }else if( zDay ){ |
| 2252 | 2252 | blob_appendf(&desc, "%d %s%s occurring on %h", n, zEType, zPlural, zDay); |
| 2253 | 2253 | }else if( zNDays ){ |
| 2254 | 2254 | blob_appendf(&desc, "%d %s%s within the past %d day%s", |
| @@ -2371,11 +2371,11 @@ | ||
| 2371 | 2371 | } |
| 2372 | 2372 | if( search_restrict(SRCH_CKIN)!=0 ){ |
| 2373 | 2373 | style_submenu_element("Search", "%R/search?y=c"); |
| 2374 | 2374 | } |
| 2375 | 2375 | if( advancedMenu ){ |
| 2376 | - style_submenu_element("Basic", "%s", | |
| 2376 | + style_submenu_element("Basic", "%s", | |
| 2377 | 2377 | url_render(&url, "advm", "0", "udc", "1")); |
| 2378 | 2378 | }else{ |
| 2379 | 2379 | style_submenu_element("Advanced", "%s", |
| 2380 | 2380 | url_render(&url, "advm", "1", "udc", "1")); |
| 2381 | 2381 | } |
| 2382 | 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 *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 @@ | ||
| 120 | 120 | return i; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /* |
| 124 | 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 | |
| 125 | +** header line. Return a copy of VALUE in space obtained from | |
| 126 | 126 | ** fossil_malloc(). Or return NULL if there is no such parameter. |
| 127 | 127 | */ |
| 128 | 128 | static char *email_hdr_value(const char *z, const char *zName){ |
| 129 | 129 | int nName = (int)strlen(zName); |
| 130 | 130 | int i; |
| @@ -358,11 +358,11 @@ | ||
| 358 | 358 | /* |
| 359 | 359 | ** Add the select/option box to the timeline submenu that shows |
| 360 | 360 | ** the various email message formats. |
| 361 | 361 | */ |
| 362 | 362 | static void webmail_f_submenu(void){ |
| 363 | - static const char *az[] = { | |
| 363 | + static const char *const az[] = { | |
| 364 | 364 | "0", "Normal", |
| 365 | 365 | "1", "Decoded", |
| 366 | 366 | "2", "Raw", |
| 367 | 367 | }; |
| 368 | 368 | style_submenu_multichoice("f", sizeof(az)/(2*sizeof(az[0])), az, 0); |
| @@ -371,11 +371,11 @@ | ||
| 371 | 371 | /* |
| 372 | 372 | ** If the first N characters of z[] are the name of a header field |
| 373 | 373 | ** that should be shown in "Normal" mode, then return 1. |
| 374 | 374 | */ |
| 375 | 375 | static int webmail_normal_header(const char *z, int N){ |
| 376 | - static const char *az[] = { | |
| 376 | + static const char *const az[] = { | |
| 377 | 377 | "To", "Cc", "Bcc", "Date", "From", "Subject", |
| 378 | 378 | }; |
| 379 | 379 | int i; |
| 380 | 380 | for(i=0; i<sizeof(az)/sizeof(az[0]); i++){ |
| 381 | 381 | if( sqlite3_strnicmp(z, az[i], N)==0 ) return 1; |
| @@ -415,11 +415,11 @@ | ||
| 415 | 415 | int eFormat = atoi(PD("f","0")); |
| 416 | 416 | eState = db_column_int(&q, 1); |
| 417 | 417 | eTranscript = db_column_int(&q, 2); |
| 418 | 418 | if( eFormat==2 ){ |
| 419 | 419 | @ <pre>%h(db_column_text(&q, 0))</pre> |
| 420 | - }else{ | |
| 420 | + }else{ | |
| 421 | 421 | EmailToc *p = emailtoc_from_email(&msg); |
| 422 | 422 | int i, j; |
| 423 | 423 | @ <p> |
| 424 | 424 | for(i=0; i<p->nHdr; i++){ |
| 425 | 425 | char *z = p->azHdr[i]; |
| @@ -563,11 +563,11 @@ | ||
| 563 | 563 | /* |
| 564 | 564 | ** Add the select/option box to the timeline submenu that shows |
| 565 | 565 | ** which messages to include in the index. |
| 566 | 566 | */ |
| 567 | 567 | static void webmail_d_submenu(void){ |
| 568 | - static const char *az[] = { | |
| 568 | + static const char *const az[] = { | |
| 569 | 569 | "0", "InBox", |
| 570 | 570 | "1", "Unread", |
| 571 | 571 | "2", "Trash", |
| 572 | 572 | "3", "Sent", |
| 573 | 573 | "4", "Everything", |
| @@ -590,11 +590,11 @@ | ||
| 590 | 590 | ** d=N 0: inbox+unread 1: unread-only 2: trash 3: all |
| 591 | 591 | ** eN Select email entry emailbox.ebid==N |
| 592 | 592 | ** trash Move selected entries to trash (estate=2) |
| 593 | 593 | ** read Mark selected entries as read (estate=1) |
| 594 | 594 | ** unread Mark selected entries as unread (estate=0) |
| 595 | -** | |
| 595 | +** | |
| 596 | 596 | */ |
| 597 | 597 | void webmail_page(void){ |
| 598 | 598 | int emailid; |
| 599 | 599 | Stmt q; |
| 600 | 600 | Blob sql; |
| @@ -769,11 +769,11 @@ | ||
| 769 | 769 | ** This page, accessible only to administrators, allows easy viewing of |
| 770 | 770 | ** the emailblob table - the table that contains the text of email messages |
| 771 | 771 | ** both inbound and outbound, and transcripts of SMTP sessions. |
| 772 | 772 | ** |
| 773 | 773 | ** id=N Show the text of emailblob with emailid==N |
| 774 | -** | |
| 774 | +** | |
| 775 | 775 | */ |
| 776 | 776 | void webmail_emailblob_page(void){ |
| 777 | 777 | int id = atoi(PD("id","0")); |
| 778 | 778 | Stmt q; |
| 779 | 779 | login_check_credentials(); |
| 780 | 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 *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 |