Fossil SCM
Reduce the number of end-of-line spaces. No functional change.
Commit
20d02ab7502e662fa955bde0f6456dda5c02a3bf
Parent
f60f9cddbab15b0…
6 files changed
+9
-9
+10
-10
+66
-66
+27
-27
+9
-9
+7
-7
+9
-9
| --- src/cache.c | ||
| +++ src/cache.c | ||
| @@ -61,11 +61,11 @@ | ||
| 61 | 61 | fossil_free(zDbName); |
| 62 | 62 | if( rc ){ |
| 63 | 63 | sqlite3_close(db); |
| 64 | 64 | return 0; |
| 65 | 65 | } |
| 66 | - rc = sqlite3_exec(db, | |
| 66 | + rc = sqlite3_exec(db, | |
| 67 | 67 | "PRAGMA page_size=8192;" |
| 68 | 68 | "CREATE TABLE IF NOT EXISTS blob(id INTEGER PRIMARY KEY, data BLOB);" |
| 69 | 69 | "CREATE TABLE IF NOT EXISTS cache(" |
| 70 | 70 | "key TEXT PRIMARY KEY," /* Key used to access the cache */ |
| 71 | 71 | "id INT REFERENCES blob," /* The cache content */ |
| @@ -94,11 +94,11 @@ | ||
| 94 | 94 | rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); |
| 95 | 95 | if( rc ){ |
| 96 | 96 | sqlite3_finalize(pStmt); |
| 97 | 97 | pStmt = 0; |
| 98 | 98 | } |
| 99 | - return pStmt; | |
| 99 | + return pStmt; | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /* |
| 103 | 103 | ** This routine implements an SQL function that renders a large integer |
| 104 | 104 | ** compactly: ex: 12.3MB |
| @@ -153,11 +153,11 @@ | ||
| 153 | 153 | if( pStmt==0 ) goto cache_write_end; |
| 154 | 154 | sqlite3_bind_blob(pStmt, 1, blob_buffer(pContent), blob_size(pContent), |
| 155 | 155 | SQLITE_STATIC); |
| 156 | 156 | if( sqlite3_step(pStmt)!=SQLITE_DONE ) goto cache_write_end; |
| 157 | 157 | sqlite3_finalize(pStmt); |
| 158 | - pStmt = cacheStmt(db, | |
| 158 | + pStmt = cacheStmt(db, | |
| 159 | 159 | "INSERT OR IGNORE INTO cache(key,sz,tm,nref,id)" |
| 160 | 160 | "VALUES(?1,?2,strftime('%s','now'),1,?3)" |
| 161 | 161 | ); |
| 162 | 162 | if( pStmt==0 ) goto cache_write_end; |
| 163 | 163 | sqlite3_bind_text(pStmt, 1, zKey, -1, SQLITE_STATIC); |
| @@ -202,27 +202,27 @@ | ||
| 202 | 202 | |
| 203 | 203 | db = cacheOpen(0); |
| 204 | 204 | if( db==0 ) return 0; |
| 205 | 205 | sqlite3_busy_timeout(db, 10000); |
| 206 | 206 | sqlite3_exec(db, "BEGIN IMMEDIATE", 0, 0, 0); |
| 207 | - pStmt = cacheStmt(db, | |
| 207 | + pStmt = cacheStmt(db, | |
| 208 | 208 | "SELECT blob.data FROM cache, blob" |
| 209 | 209 | " WHERE cache.key=?1 AND cache.id=blob.id"); |
| 210 | 210 | if( pStmt==0 ) goto cache_read_done; |
| 211 | 211 | sqlite3_bind_text(pStmt, 1, zKey, -1, SQLITE_STATIC); |
| 212 | 212 | if( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 213 | 213 | blob_append(pContent, sqlite3_column_blob(pStmt, 0), |
| 214 | 214 | sqlite3_column_bytes(pStmt, 0)); |
| 215 | 215 | rc = 1; |
| 216 | 216 | sqlite3_reset(pStmt); |
| 217 | - pStmt = cacheStmt(db, | |
| 217 | + pStmt = cacheStmt(db, | |
| 218 | 218 | "UPDATE cache SET nref=nref+1, tm=strftime('%s','now')" |
| 219 | 219 | " WHERE key=?1"); |
| 220 | 220 | if( pStmt ){ |
| 221 | 221 | sqlite3_bind_text(pStmt, 1, zKey, -1, SQLITE_STATIC); |
| 222 | 222 | sqlite3_step(pStmt); |
| 223 | - } | |
| 223 | + } | |
| 224 | 224 | } |
| 225 | 225 | sqlite3_finalize(pStmt); |
| 226 | 226 | cache_read_done: |
| 227 | 227 | sqlite3_exec(db, "COMMIT", 0, 0, 0); |
| 228 | 228 | sqlite3_close(db); |
| @@ -256,11 +256,11 @@ | ||
| 256 | 256 | sqlite3_stmt *pStmt; |
| 257 | 257 | |
| 258 | 258 | db_find_and_open_repository(0,0); |
| 259 | 259 | zCmd = g.argc>=3 ? g.argv[2] : ""; |
| 260 | 260 | nCmd = (int)strlen(zCmd); |
| 261 | - if( nCmd<=1 ){ | |
| 261 | + if( nCmd<=1 ){ | |
| 262 | 262 | fossil_fatal("Usage: %s cache SUBCOMMAND", g.argv[0]); |
| 263 | 263 | } |
| 264 | 264 | if( strncmp(zCmd, "init", nCmd)==0 ){ |
| 265 | 265 | db = cacheOpen(0); |
| 266 | 266 | sqlite3_close(db); |
| @@ -290,11 +290,11 @@ | ||
| 290 | 290 | fossil_print("cache does not exist\n"); |
| 291 | 291 | }else{ |
| 292 | 292 | int nEntry = 0; |
| 293 | 293 | char *zDbName = cacheName(); |
| 294 | 294 | cache_register_sizename(db); |
| 295 | - pStmt = cacheStmt(db, | |
| 295 | + pStmt = cacheStmt(db, | |
| 296 | 296 | "SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')" |
| 297 | 297 | " FROM cache" |
| 298 | 298 | " ORDER BY tm DESC" |
| 299 | 299 | ); |
| 300 | 300 | if( pStmt ){ |
| @@ -338,11 +338,11 @@ | ||
| 338 | 338 | if( db==0 ){ |
| 339 | 339 | @ The web-page cache is disabled for this repository |
| 340 | 340 | }else{ |
| 341 | 341 | char *zDbName = cacheName(); |
| 342 | 342 | cache_register_sizename(db); |
| 343 | - pStmt = cacheStmt(db, | |
| 343 | + pStmt = cacheStmt(db, | |
| 344 | 344 | "SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')" |
| 345 | 345 | " FROM cache" |
| 346 | 346 | " ORDER BY tm DESC" |
| 347 | 347 | ); |
| 348 | 348 | if( pStmt ){ |
| 349 | 349 |
| --- src/cache.c | |
| +++ src/cache.c | |
| @@ -61,11 +61,11 @@ | |
| 61 | fossil_free(zDbName); |
| 62 | if( rc ){ |
| 63 | sqlite3_close(db); |
| 64 | return 0; |
| 65 | } |
| 66 | rc = sqlite3_exec(db, |
| 67 | "PRAGMA page_size=8192;" |
| 68 | "CREATE TABLE IF NOT EXISTS blob(id INTEGER PRIMARY KEY, data BLOB);" |
| 69 | "CREATE TABLE IF NOT EXISTS cache(" |
| 70 | "key TEXT PRIMARY KEY," /* Key used to access the cache */ |
| 71 | "id INT REFERENCES blob," /* The cache content */ |
| @@ -94,11 +94,11 @@ | |
| 94 | rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); |
| 95 | if( rc ){ |
| 96 | sqlite3_finalize(pStmt); |
| 97 | pStmt = 0; |
| 98 | } |
| 99 | return pStmt; |
| 100 | } |
| 101 | |
| 102 | /* |
| 103 | ** This routine implements an SQL function that renders a large integer |
| 104 | ** compactly: ex: 12.3MB |
| @@ -153,11 +153,11 @@ | |
| 153 | if( pStmt==0 ) goto cache_write_end; |
| 154 | sqlite3_bind_blob(pStmt, 1, blob_buffer(pContent), blob_size(pContent), |
| 155 | SQLITE_STATIC); |
| 156 | if( sqlite3_step(pStmt)!=SQLITE_DONE ) goto cache_write_end; |
| 157 | sqlite3_finalize(pStmt); |
| 158 | pStmt = cacheStmt(db, |
| 159 | "INSERT OR IGNORE INTO cache(key,sz,tm,nref,id)" |
| 160 | "VALUES(?1,?2,strftime('%s','now'),1,?3)" |
| 161 | ); |
| 162 | if( pStmt==0 ) goto cache_write_end; |
| 163 | sqlite3_bind_text(pStmt, 1, zKey, -1, SQLITE_STATIC); |
| @@ -202,27 +202,27 @@ | |
| 202 | |
| 203 | db = cacheOpen(0); |
| 204 | if( db==0 ) return 0; |
| 205 | sqlite3_busy_timeout(db, 10000); |
| 206 | sqlite3_exec(db, "BEGIN IMMEDIATE", 0, 0, 0); |
| 207 | pStmt = cacheStmt(db, |
| 208 | "SELECT blob.data FROM cache, blob" |
| 209 | " WHERE cache.key=?1 AND cache.id=blob.id"); |
| 210 | if( pStmt==0 ) goto cache_read_done; |
| 211 | sqlite3_bind_text(pStmt, 1, zKey, -1, SQLITE_STATIC); |
| 212 | if( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 213 | blob_append(pContent, sqlite3_column_blob(pStmt, 0), |
| 214 | sqlite3_column_bytes(pStmt, 0)); |
| 215 | rc = 1; |
| 216 | sqlite3_reset(pStmt); |
| 217 | pStmt = cacheStmt(db, |
| 218 | "UPDATE cache SET nref=nref+1, tm=strftime('%s','now')" |
| 219 | " WHERE key=?1"); |
| 220 | if( pStmt ){ |
| 221 | sqlite3_bind_text(pStmt, 1, zKey, -1, SQLITE_STATIC); |
| 222 | sqlite3_step(pStmt); |
| 223 | } |
| 224 | } |
| 225 | sqlite3_finalize(pStmt); |
| 226 | cache_read_done: |
| 227 | sqlite3_exec(db, "COMMIT", 0, 0, 0); |
| 228 | sqlite3_close(db); |
| @@ -256,11 +256,11 @@ | |
| 256 | sqlite3_stmt *pStmt; |
| 257 | |
| 258 | db_find_and_open_repository(0,0); |
| 259 | zCmd = g.argc>=3 ? g.argv[2] : ""; |
| 260 | nCmd = (int)strlen(zCmd); |
| 261 | if( nCmd<=1 ){ |
| 262 | fossil_fatal("Usage: %s cache SUBCOMMAND", g.argv[0]); |
| 263 | } |
| 264 | if( strncmp(zCmd, "init", nCmd)==0 ){ |
| 265 | db = cacheOpen(0); |
| 266 | sqlite3_close(db); |
| @@ -290,11 +290,11 @@ | |
| 290 | fossil_print("cache does not exist\n"); |
| 291 | }else{ |
| 292 | int nEntry = 0; |
| 293 | char *zDbName = cacheName(); |
| 294 | cache_register_sizename(db); |
| 295 | pStmt = cacheStmt(db, |
| 296 | "SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')" |
| 297 | " FROM cache" |
| 298 | " ORDER BY tm DESC" |
| 299 | ); |
| 300 | if( pStmt ){ |
| @@ -338,11 +338,11 @@ | |
| 338 | if( db==0 ){ |
| 339 | @ The web-page cache is disabled for this repository |
| 340 | }else{ |
| 341 | char *zDbName = cacheName(); |
| 342 | cache_register_sizename(db); |
| 343 | pStmt = cacheStmt(db, |
| 344 | "SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')" |
| 345 | " FROM cache" |
| 346 | " ORDER BY tm DESC" |
| 347 | ); |
| 348 | if( pStmt ){ |
| 349 |
| --- src/cache.c | |
| +++ src/cache.c | |
| @@ -61,11 +61,11 @@ | |
| 61 | fossil_free(zDbName); |
| 62 | if( rc ){ |
| 63 | sqlite3_close(db); |
| 64 | return 0; |
| 65 | } |
| 66 | rc = sqlite3_exec(db, |
| 67 | "PRAGMA page_size=8192;" |
| 68 | "CREATE TABLE IF NOT EXISTS blob(id INTEGER PRIMARY KEY, data BLOB);" |
| 69 | "CREATE TABLE IF NOT EXISTS cache(" |
| 70 | "key TEXT PRIMARY KEY," /* Key used to access the cache */ |
| 71 | "id INT REFERENCES blob," /* The cache content */ |
| @@ -94,11 +94,11 @@ | |
| 94 | rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); |
| 95 | if( rc ){ |
| 96 | sqlite3_finalize(pStmt); |
| 97 | pStmt = 0; |
| 98 | } |
| 99 | return pStmt; |
| 100 | } |
| 101 | |
| 102 | /* |
| 103 | ** This routine implements an SQL function that renders a large integer |
| 104 | ** compactly: ex: 12.3MB |
| @@ -153,11 +153,11 @@ | |
| 153 | if( pStmt==0 ) goto cache_write_end; |
| 154 | sqlite3_bind_blob(pStmt, 1, blob_buffer(pContent), blob_size(pContent), |
| 155 | SQLITE_STATIC); |
| 156 | if( sqlite3_step(pStmt)!=SQLITE_DONE ) goto cache_write_end; |
| 157 | sqlite3_finalize(pStmt); |
| 158 | pStmt = cacheStmt(db, |
| 159 | "INSERT OR IGNORE INTO cache(key,sz,tm,nref,id)" |
| 160 | "VALUES(?1,?2,strftime('%s','now'),1,?3)" |
| 161 | ); |
| 162 | if( pStmt==0 ) goto cache_write_end; |
| 163 | sqlite3_bind_text(pStmt, 1, zKey, -1, SQLITE_STATIC); |
| @@ -202,27 +202,27 @@ | |
| 202 | |
| 203 | db = cacheOpen(0); |
| 204 | if( db==0 ) return 0; |
| 205 | sqlite3_busy_timeout(db, 10000); |
| 206 | sqlite3_exec(db, "BEGIN IMMEDIATE", 0, 0, 0); |
| 207 | pStmt = cacheStmt(db, |
| 208 | "SELECT blob.data FROM cache, blob" |
| 209 | " WHERE cache.key=?1 AND cache.id=blob.id"); |
| 210 | if( pStmt==0 ) goto cache_read_done; |
| 211 | sqlite3_bind_text(pStmt, 1, zKey, -1, SQLITE_STATIC); |
| 212 | if( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 213 | blob_append(pContent, sqlite3_column_blob(pStmt, 0), |
| 214 | sqlite3_column_bytes(pStmt, 0)); |
| 215 | rc = 1; |
| 216 | sqlite3_reset(pStmt); |
| 217 | pStmt = cacheStmt(db, |
| 218 | "UPDATE cache SET nref=nref+1, tm=strftime('%s','now')" |
| 219 | " WHERE key=?1"); |
| 220 | if( pStmt ){ |
| 221 | sqlite3_bind_text(pStmt, 1, zKey, -1, SQLITE_STATIC); |
| 222 | sqlite3_step(pStmt); |
| 223 | } |
| 224 | } |
| 225 | sqlite3_finalize(pStmt); |
| 226 | cache_read_done: |
| 227 | sqlite3_exec(db, "COMMIT", 0, 0, 0); |
| 228 | sqlite3_close(db); |
| @@ -256,11 +256,11 @@ | |
| 256 | sqlite3_stmt *pStmt; |
| 257 | |
| 258 | db_find_and_open_repository(0,0); |
| 259 | zCmd = g.argc>=3 ? g.argv[2] : ""; |
| 260 | nCmd = (int)strlen(zCmd); |
| 261 | if( nCmd<=1 ){ |
| 262 | fossil_fatal("Usage: %s cache SUBCOMMAND", g.argv[0]); |
| 263 | } |
| 264 | if( strncmp(zCmd, "init", nCmd)==0 ){ |
| 265 | db = cacheOpen(0); |
| 266 | sqlite3_close(db); |
| @@ -290,11 +290,11 @@ | |
| 290 | fossil_print("cache does not exist\n"); |
| 291 | }else{ |
| 292 | int nEntry = 0; |
| 293 | char *zDbName = cacheName(); |
| 294 | cache_register_sizename(db); |
| 295 | pStmt = cacheStmt(db, |
| 296 | "SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')" |
| 297 | " FROM cache" |
| 298 | " ORDER BY tm DESC" |
| 299 | ); |
| 300 | if( pStmt ){ |
| @@ -338,11 +338,11 @@ | |
| 338 | if( db==0 ){ |
| 339 | @ The web-page cache is disabled for this repository |
| 340 | }else{ |
| 341 | char *zDbName = cacheName(); |
| 342 | cache_register_sizename(db); |
| 343 | pStmt = cacheStmt(db, |
| 344 | "SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')" |
| 345 | " FROM cache" |
| 346 | " ORDER BY tm DESC" |
| 347 | ); |
| 348 | if( pStmt ){ |
| 349 |
+10
-10
| --- src/delta.c | ||
| +++ src/delta.c | ||
| @@ -65,11 +65,11 @@ | ||
| 65 | 65 | ** The "u32" type must be an unsigned 32-bit integer. Adjust this |
| 66 | 66 | */ |
| 67 | 67 | typedef unsigned int u32; |
| 68 | 68 | |
| 69 | 69 | /* |
| 70 | -** Must be a 16-bit value | |
| 70 | +** Must be a 16-bit value | |
| 71 | 71 | */ |
| 72 | 72 | typedef short int s16; |
| 73 | 73 | typedef unsigned short int u16; |
| 74 | 74 | |
| 75 | 75 | #endif /* INTERFACE */ |
| @@ -82,11 +82,11 @@ | ||
| 82 | 82 | |
| 83 | 83 | /* |
| 84 | 84 | ** The current state of the rolling hash. |
| 85 | 85 | ** |
| 86 | 86 | ** z[] holds the values that have been hashed. z[] is a circular buffer. |
| 87 | -** z[i] is the first entry and z[(i+NHASH-1)%NHASH] is the last entry of | |
| 87 | +** z[i] is the first entry and z[(i+NHASH-1)%NHASH] is the last entry of | |
| 88 | 88 | ** the window. |
| 89 | 89 | ** |
| 90 | 90 | ** Hash.a is the sum of all elements of hash.z[]. Hash.b is a weighted |
| 91 | 91 | ** sum. Hash.b is z[i]*NHASH + z[i+1]*(NHASH-1) + ... + z[i+NHASH-1]*1. |
| 92 | 92 | ** (Each index for z[] should be module NHASH, of course. The %NHASH operator |
| @@ -135,11 +135,11 @@ | ||
| 135 | 135 | |
| 136 | 136 | /* |
| 137 | 137 | ** Write an base-64 integer into the given buffer. |
| 138 | 138 | */ |
| 139 | 139 | static void putInt(unsigned int v, char **pz){ |
| 140 | - static const char zDigits[] = | |
| 140 | + static const char zDigits[] = | |
| 141 | 141 | "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~"; |
| 142 | 142 | /* 123456789 123456789 123456789 123456789 123456789 123456789 123 */ |
| 143 | 143 | int i, j; |
| 144 | 144 | char zBuf[20]; |
| 145 | 145 | if( v==0 ){ |
| @@ -229,11 +229,11 @@ | ||
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /* |
| 232 | 232 | ** Create a new delta. |
| 233 | 233 | ** |
| 234 | -** The delta is written into a preallocated buffer, zDelta, which | |
| 234 | +** The delta is written into a preallocated buffer, zDelta, which | |
| 235 | 235 | ** should be at least 60 bytes longer than the target file, zOut. |
| 236 | 236 | ** The delta string will be NUL-terminated, but it might also contain |
| 237 | 237 | ** embedded NUL characters if either the zSrc or zOut files are |
| 238 | 238 | ** binary. This function returns the length of the delta string |
| 239 | 239 | ** in bytes, excluding the final NUL terminator character. |
| @@ -245,11 +245,11 @@ | ||
| 245 | 245 | ** delta file z, a program can compute the size of the output file |
| 246 | 246 | ** simply by reading the first line and decoding the base-64 number |
| 247 | 247 | ** found there. The delta_output_size() routine does exactly this. |
| 248 | 248 | ** |
| 249 | 249 | ** After the initial size number, the delta consists of a series of |
| 250 | -** literal text segments and commands to copy from the SOURCE file. | |
| 250 | +** literal text segments and commands to copy from the SOURCE file. | |
| 251 | 251 | ** A copy command looks like this: |
| 252 | 252 | ** |
| 253 | 253 | ** NNN@MMM, |
| 254 | 254 | ** |
| 255 | 255 | ** where NNN is the number of bytes to be copied and MMM is the offset |
| @@ -283,11 +283,11 @@ | ||
| 283 | 283 | ** search for a matching section in the source file. When a match |
| 284 | 284 | ** is found, a copy command is added to the delta. An effort is |
| 285 | 285 | ** made to extend the matching section to regions that come before |
| 286 | 286 | ** and after the 16-byte hash window. A copy command is only issued |
| 287 | 287 | ** if the result would use less space that just quoting the text |
| 288 | -** literally. Literal text is added to the delta for sections that | |
| 288 | +** literally. Literal text is added to the delta for sections that | |
| 289 | 289 | ** do not match or which can not be encoded efficiently using copy |
| 290 | 290 | ** commands. |
| 291 | 291 | */ |
| 292 | 292 | int delta_create( |
| 293 | 293 | const char *zSrc, /* The source or pattern file */ |
| @@ -356,13 +356,13 @@ | ||
| 356 | 356 | hv = hash_32bit(&h) % nHash; |
| 357 | 357 | DEBUG2( printf("LOOKING: %4d [%s]\n", base+i, print16(&zOut[base+i])); ) |
| 358 | 358 | iBlock = landmark[hv]; |
| 359 | 359 | while( iBlock>=0 && (limit--)>0 ){ |
| 360 | 360 | /* |
| 361 | - ** The hash window has identified a potential match against | |
| 361 | + ** The hash window has identified a potential match against | |
| 362 | 362 | ** landmark block iBlock. But we need to investigate further. |
| 363 | - ** | |
| 363 | + ** | |
| 364 | 364 | ** Look for a region in zOut that matches zSrc. Anchor the search |
| 365 | 365 | ** at zSrc[iSrc] and zOut[base+i]. Do not include anything prior to |
| 366 | 366 | ** zOut[base] or after zOut[outLen] nor anything after zSrc[srcLen]. |
| 367 | 367 | ** |
| 368 | 368 | ** Set cnt equal to the length of the match and set ofst so that |
| @@ -468,16 +468,16 @@ | ||
| 468 | 468 | } |
| 469 | 469 | /* Output the final checksum record. */ |
| 470 | 470 | putInt(checksum(zOut, lenOut), &zDelta); |
| 471 | 471 | *(zDelta++) = ';'; |
| 472 | 472 | fossil_free(collide); |
| 473 | - return zDelta - zOrigDelta; | |
| 473 | + return zDelta - zOrigDelta; | |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | /* |
| 477 | 477 | ** Return the size (in bytes) of the output from applying |
| 478 | -** a delta. | |
| 478 | +** a delta. | |
| 479 | 479 | ** |
| 480 | 480 | ** This routine is provided so that an procedure that is able |
| 481 | 481 | ** to call delta_apply() can learn how much space is required |
| 482 | 482 | ** for the output and hence allocate nor more space that is really |
| 483 | 483 | ** needed. |
| 484 | 484 |
| --- src/delta.c | |
| +++ src/delta.c | |
| @@ -65,11 +65,11 @@ | |
| 65 | ** The "u32" type must be an unsigned 32-bit integer. Adjust this |
| 66 | */ |
| 67 | typedef unsigned int u32; |
| 68 | |
| 69 | /* |
| 70 | ** Must be a 16-bit value |
| 71 | */ |
| 72 | typedef short int s16; |
| 73 | typedef unsigned short int u16; |
| 74 | |
| 75 | #endif /* INTERFACE */ |
| @@ -82,11 +82,11 @@ | |
| 82 | |
| 83 | /* |
| 84 | ** The current state of the rolling hash. |
| 85 | ** |
| 86 | ** z[] holds the values that have been hashed. z[] is a circular buffer. |
| 87 | ** z[i] is the first entry and z[(i+NHASH-1)%NHASH] is the last entry of |
| 88 | ** the window. |
| 89 | ** |
| 90 | ** Hash.a is the sum of all elements of hash.z[]. Hash.b is a weighted |
| 91 | ** sum. Hash.b is z[i]*NHASH + z[i+1]*(NHASH-1) + ... + z[i+NHASH-1]*1. |
| 92 | ** (Each index for z[] should be module NHASH, of course. The %NHASH operator |
| @@ -135,11 +135,11 @@ | |
| 135 | |
| 136 | /* |
| 137 | ** Write an base-64 integer into the given buffer. |
| 138 | */ |
| 139 | static void putInt(unsigned int v, char **pz){ |
| 140 | static const char zDigits[] = |
| 141 | "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~"; |
| 142 | /* 123456789 123456789 123456789 123456789 123456789 123456789 123 */ |
| 143 | int i, j; |
| 144 | char zBuf[20]; |
| 145 | if( v==0 ){ |
| @@ -229,11 +229,11 @@ | |
| 229 | } |
| 230 | |
| 231 | /* |
| 232 | ** Create a new delta. |
| 233 | ** |
| 234 | ** The delta is written into a preallocated buffer, zDelta, which |
| 235 | ** should be at least 60 bytes longer than the target file, zOut. |
| 236 | ** The delta string will be NUL-terminated, but it might also contain |
| 237 | ** embedded NUL characters if either the zSrc or zOut files are |
| 238 | ** binary. This function returns the length of the delta string |
| 239 | ** in bytes, excluding the final NUL terminator character. |
| @@ -245,11 +245,11 @@ | |
| 245 | ** delta file z, a program can compute the size of the output file |
| 246 | ** simply by reading the first line and decoding the base-64 number |
| 247 | ** found there. The delta_output_size() routine does exactly this. |
| 248 | ** |
| 249 | ** After the initial size number, the delta consists of a series of |
| 250 | ** literal text segments and commands to copy from the SOURCE file. |
| 251 | ** A copy command looks like this: |
| 252 | ** |
| 253 | ** NNN@MMM, |
| 254 | ** |
| 255 | ** where NNN is the number of bytes to be copied and MMM is the offset |
| @@ -283,11 +283,11 @@ | |
| 283 | ** search for a matching section in the source file. When a match |
| 284 | ** is found, a copy command is added to the delta. An effort is |
| 285 | ** made to extend the matching section to regions that come before |
| 286 | ** and after the 16-byte hash window. A copy command is only issued |
| 287 | ** if the result would use less space that just quoting the text |
| 288 | ** literally. Literal text is added to the delta for sections that |
| 289 | ** do not match or which can not be encoded efficiently using copy |
| 290 | ** commands. |
| 291 | */ |
| 292 | int delta_create( |
| 293 | const char *zSrc, /* The source or pattern file */ |
| @@ -356,13 +356,13 @@ | |
| 356 | hv = hash_32bit(&h) % nHash; |
| 357 | DEBUG2( printf("LOOKING: %4d [%s]\n", base+i, print16(&zOut[base+i])); ) |
| 358 | iBlock = landmark[hv]; |
| 359 | while( iBlock>=0 && (limit--)>0 ){ |
| 360 | /* |
| 361 | ** The hash window has identified a potential match against |
| 362 | ** landmark block iBlock. But we need to investigate further. |
| 363 | ** |
| 364 | ** Look for a region in zOut that matches zSrc. Anchor the search |
| 365 | ** at zSrc[iSrc] and zOut[base+i]. Do not include anything prior to |
| 366 | ** zOut[base] or after zOut[outLen] nor anything after zSrc[srcLen]. |
| 367 | ** |
| 368 | ** Set cnt equal to the length of the match and set ofst so that |
| @@ -468,16 +468,16 @@ | |
| 468 | } |
| 469 | /* Output the final checksum record. */ |
| 470 | putInt(checksum(zOut, lenOut), &zDelta); |
| 471 | *(zDelta++) = ';'; |
| 472 | fossil_free(collide); |
| 473 | return zDelta - zOrigDelta; |
| 474 | } |
| 475 | |
| 476 | /* |
| 477 | ** Return the size (in bytes) of the output from applying |
| 478 | ** a delta. |
| 479 | ** |
| 480 | ** This routine is provided so that an procedure that is able |
| 481 | ** to call delta_apply() can learn how much space is required |
| 482 | ** for the output and hence allocate nor more space that is really |
| 483 | ** needed. |
| 484 |
| --- src/delta.c | |
| +++ src/delta.c | |
| @@ -65,11 +65,11 @@ | |
| 65 | ** The "u32" type must be an unsigned 32-bit integer. Adjust this |
| 66 | */ |
| 67 | typedef unsigned int u32; |
| 68 | |
| 69 | /* |
| 70 | ** Must be a 16-bit value |
| 71 | */ |
| 72 | typedef short int s16; |
| 73 | typedef unsigned short int u16; |
| 74 | |
| 75 | #endif /* INTERFACE */ |
| @@ -82,11 +82,11 @@ | |
| 82 | |
| 83 | /* |
| 84 | ** The current state of the rolling hash. |
| 85 | ** |
| 86 | ** z[] holds the values that have been hashed. z[] is a circular buffer. |
| 87 | ** z[i] is the first entry and z[(i+NHASH-1)%NHASH] is the last entry of |
| 88 | ** the window. |
| 89 | ** |
| 90 | ** Hash.a is the sum of all elements of hash.z[]. Hash.b is a weighted |
| 91 | ** sum. Hash.b is z[i]*NHASH + z[i+1]*(NHASH-1) + ... + z[i+NHASH-1]*1. |
| 92 | ** (Each index for z[] should be module NHASH, of course. The %NHASH operator |
| @@ -135,11 +135,11 @@ | |
| 135 | |
| 136 | /* |
| 137 | ** Write an base-64 integer into the given buffer. |
| 138 | */ |
| 139 | static void putInt(unsigned int v, char **pz){ |
| 140 | static const char zDigits[] = |
| 141 | "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~"; |
| 142 | /* 123456789 123456789 123456789 123456789 123456789 123456789 123 */ |
| 143 | int i, j; |
| 144 | char zBuf[20]; |
| 145 | if( v==0 ){ |
| @@ -229,11 +229,11 @@ | |
| 229 | } |
| 230 | |
| 231 | /* |
| 232 | ** Create a new delta. |
| 233 | ** |
| 234 | ** The delta is written into a preallocated buffer, zDelta, which |
| 235 | ** should be at least 60 bytes longer than the target file, zOut. |
| 236 | ** The delta string will be NUL-terminated, but it might also contain |
| 237 | ** embedded NUL characters if either the zSrc or zOut files are |
| 238 | ** binary. This function returns the length of the delta string |
| 239 | ** in bytes, excluding the final NUL terminator character. |
| @@ -245,11 +245,11 @@ | |
| 245 | ** delta file z, a program can compute the size of the output file |
| 246 | ** simply by reading the first line and decoding the base-64 number |
| 247 | ** found there. The delta_output_size() routine does exactly this. |
| 248 | ** |
| 249 | ** After the initial size number, the delta consists of a series of |
| 250 | ** literal text segments and commands to copy from the SOURCE file. |
| 251 | ** A copy command looks like this: |
| 252 | ** |
| 253 | ** NNN@MMM, |
| 254 | ** |
| 255 | ** where NNN is the number of bytes to be copied and MMM is the offset |
| @@ -283,11 +283,11 @@ | |
| 283 | ** search for a matching section in the source file. When a match |
| 284 | ** is found, a copy command is added to the delta. An effort is |
| 285 | ** made to extend the matching section to regions that come before |
| 286 | ** and after the 16-byte hash window. A copy command is only issued |
| 287 | ** if the result would use less space that just quoting the text |
| 288 | ** literally. Literal text is added to the delta for sections that |
| 289 | ** do not match or which can not be encoded efficiently using copy |
| 290 | ** commands. |
| 291 | */ |
| 292 | int delta_create( |
| 293 | const char *zSrc, /* The source or pattern file */ |
| @@ -356,13 +356,13 @@ | |
| 356 | hv = hash_32bit(&h) % nHash; |
| 357 | DEBUG2( printf("LOOKING: %4d [%s]\n", base+i, print16(&zOut[base+i])); ) |
| 358 | iBlock = landmark[hv]; |
| 359 | while( iBlock>=0 && (limit--)>0 ){ |
| 360 | /* |
| 361 | ** The hash window has identified a potential match against |
| 362 | ** landmark block iBlock. But we need to investigate further. |
| 363 | ** |
| 364 | ** Look for a region in zOut that matches zSrc. Anchor the search |
| 365 | ** at zSrc[iSrc] and zOut[base+i]. Do not include anything prior to |
| 366 | ** zOut[base] or after zOut[outLen] nor anything after zSrc[srcLen]. |
| 367 | ** |
| 368 | ** Set cnt equal to the length of the match and set ofst so that |
| @@ -468,16 +468,16 @@ | |
| 468 | } |
| 469 | /* Output the final checksum record. */ |
| 470 | putInt(checksum(zOut, lenOut), &zDelta); |
| 471 | *(zDelta++) = ';'; |
| 472 | fossil_free(collide); |
| 473 | return zDelta - zOrigDelta; |
| 474 | } |
| 475 | |
| 476 | /* |
| 477 | ** Return the size (in bytes) of the output from applying |
| 478 | ** a delta. |
| 479 | ** |
| 480 | ** This routine is provided so that an procedure that is able |
| 481 | ** to call delta_apply() can learn how much space is required |
| 482 | ** for the output and hence allocate nor more space that is really |
| 483 | ** needed. |
| 484 |
+66
-66
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -26,11 +26,11 @@ | ||
| 26 | 26 | ** Try to guess the mimetype from content. |
| 27 | 27 | ** |
| 28 | 28 | ** If the content is pure text, return NULL. |
| 29 | 29 | ** |
| 30 | 30 | ** For image types, attempt to return an appropriate mimetype |
| 31 | -** name like "image/gif" or "image/jpeg". | |
| 31 | +** name like "image/gif" or "image/jpeg". | |
| 32 | 32 | ** |
| 33 | 33 | ** For any other binary type, return "unknown/unknown". |
| 34 | 34 | */ |
| 35 | 35 | const char *mimetype_from_content(Blob *pBlob){ |
| 36 | 36 | int i; |
| @@ -83,11 +83,11 @@ | ||
| 83 | 83 | int i; |
| 84 | 84 | int first, last; |
| 85 | 85 | int len; |
| 86 | 86 | char zSuffix[20]; |
| 87 | 87 | |
| 88 | - /* A table of mimetypes based on file suffixes. | |
| 88 | + /* A table of mimetypes based on file suffixes. | |
| 89 | 89 | ** Suffixes must be in sorted order so that we can do a binary |
| 90 | 90 | ** search to find the mime-type |
| 91 | 91 | */ |
| 92 | 92 | static const struct { |
| 93 | 93 | const char *zSuffix; /* The file suffix */ |
| @@ -487,11 +487,11 @@ | ||
| 487 | 487 | db_end_transaction(0); |
| 488 | 488 | } |
| 489 | 489 | blob_to_utf8_no_bom(&filebody, 0); |
| 490 | 490 | |
| 491 | 491 | /* The file is now contained in the filebody blob. Deliver the |
| 492 | - ** file to the user | |
| 492 | + ** file to the user | |
| 493 | 493 | */ |
| 494 | 494 | zMime = P("mimetype"); |
| 495 | 495 | if( zMime==0 ){ |
| 496 | 496 | zMime = mimetype_from_name(zName); |
| 497 | 497 | } |
| @@ -546,79 +546,79 @@ | ||
| 546 | 546 | /* Jump here when unable to locate the document */ |
| 547 | 547 | db_end_transaction(0); |
| 548 | 548 | style_header("Document Not Found"); |
| 549 | 549 | @ <p>No such document: %h(zName)</p> |
| 550 | 550 | style_footer(); |
| 551 | - return; | |
| 551 | + return; | |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | /* |
| 555 | 555 | ** The default logo. |
| 556 | 556 | */ |
| 557 | 557 | static const unsigned char aLogo[] = { |
| 558 | - 71, 73, 70, 56, 55, 97, 62, 0, 71, 0, 244, 0, 0, 85, | |
| 559 | - 129, 149, 95, 136, 155, 99, 139, 157, 106, 144, 162, 113, 150, 166, | |
| 560 | - 116, 152, 168, 127, 160, 175, 138, 168, 182, 148, 176, 188, 159, 184, | |
| 561 | - 195, 170, 192, 202, 180, 199, 208, 184, 202, 210, 191, 207, 215, 201, | |
| 562 | - 215, 221, 212, 223, 228, 223, 231, 235, 226, 227, 226, 226, 234, 237, | |
| 563 | - 233, 239, 241, 240, 244, 246, 244, 247, 248, 255, 255, 255, 0, 0, | |
| 564 | - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 565 | - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, | |
| 566 | - 0, 0, 62, 0, 71, 0, 0, 5, 255, 96, 100, 141, 100, 105, | |
| 567 | - 158, 168, 37, 41, 132, 192, 164, 112, 44, 207, 102, 99, 0, 56, | |
| 568 | - 16, 84, 116, 239, 199, 141, 65, 110, 232, 248, 25, 141, 193, 161, | |
| 569 | - 82, 113, 108, 202, 32, 55, 229, 210, 73, 61, 41, 164, 88, 102, | |
| 570 | - 181, 10, 41, 96, 179, 91, 106, 35, 240, 5, 135, 143, 137, 242, | |
| 571 | - 87, 123, 246, 33, 190, 81, 108, 163, 237, 198, 14, 30, 113, 233, | |
| 572 | - 131, 78, 115, 72, 11, 115, 87, 101, 19, 124, 51, 66, 74, 8, | |
| 573 | - 19, 16, 67, 100, 74, 133, 50, 15, 101, 135, 56, 11, 74, 6, | |
| 574 | - 143, 49, 126, 106, 56, 8, 145, 67, 9, 152, 48, 139, 155, 5, | |
| 575 | - 22, 13, 74, 115, 161, 41, 147, 101, 13, 130, 57, 132, 170, 40, | |
| 576 | - 167, 155, 0, 94, 57, 3, 178, 48, 183, 181, 57, 160, 186, 40, | |
| 577 | - 19, 141, 189, 0, 69, 192, 40, 16, 195, 155, 185, 199, 41, 201, | |
| 578 | - 189, 191, 205, 193, 188, 131, 210, 49, 175, 88, 209, 214, 38, 19, | |
| 579 | - 3, 11, 19, 111, 127, 60, 219, 39, 55, 204, 19, 11, 6, 100, | |
| 580 | - 5, 10, 227, 228, 37, 163, 0, 239, 117, 56, 238, 243, 49, 195, | |
| 581 | - 177, 247, 48, 158, 56, 251, 50, 216, 254, 197, 56, 128, 107, 158, | |
| 582 | - 2, 125, 171, 114, 92, 218, 246, 96, 66, 3, 4, 50, 134, 176, | |
| 583 | - 145, 6, 97, 64, 144, 24, 19, 136, 108, 91, 177, 160, 0, 194, | |
| 584 | - 19, 253, 0, 216, 107, 214, 224, 192, 129, 5, 16, 83, 255, 244, | |
| 585 | - 43, 213, 195, 24, 159, 27, 169, 64, 230, 88, 208, 227, 129, 182, | |
| 586 | - 54, 4, 89, 158, 24, 181, 163, 199, 1, 155, 52, 233, 8, 130, | |
| 587 | - 176, 83, 24, 128, 137, 50, 18, 32, 48, 48, 114, 11, 173, 137, | |
| 588 | - 19, 110, 4, 64, 105, 1, 194, 30, 140, 68, 15, 24, 24, 224, | |
| 589 | - 50, 76, 70, 0, 11, 171, 54, 26, 160, 181, 194, 149, 148, 40, | |
| 590 | - 174, 148, 122, 64, 180, 208, 161, 17, 207, 112, 164, 1, 128, 96, | |
| 591 | - 148, 78, 18, 21, 194, 33, 229, 51, 247, 65, 133, 97, 5, 250, | |
| 592 | - 69, 229, 100, 34, 220, 128, 166, 116, 190, 62, 8, 167, 195, 170, | |
| 593 | - 47, 163, 0, 130, 90, 152, 11, 160, 173, 170, 27, 154, 26, 91, | |
| 594 | - 232, 151, 171, 18, 14, 162, 253, 98, 170, 18, 70, 171, 64, 219, | |
| 595 | - 10, 67, 136, 134, 187, 116, 75, 180, 46, 179, 174, 135, 4, 189, | |
| 596 | - 229, 231, 78, 40, 10, 62, 226, 164, 172, 64, 240, 167, 170, 10, | |
| 597 | - 18, 124, 188, 10, 107, 65, 193, 94, 11, 93, 171, 28, 248, 17, | |
| 598 | - 239, 46, 140, 78, 97, 34, 25, 153, 36, 99, 65, 130, 7, 203, | |
| 599 | - 183, 168, 51, 34, 136, 25, 140, 10, 6, 16, 28, 255, 145, 241, | |
| 600 | - 230, 140, 10, 66, 178, 167, 112, 48, 192, 128, 129, 9, 31, 141, | |
| 601 | - 84, 138, 63, 163, 162, 2, 203, 206, 240, 56, 55, 98, 192, 188, | |
| 602 | - 15, 185, 50, 160, 6, 0, 125, 62, 33, 214, 195, 33, 5, 24, | |
| 603 | - 184, 25, 231, 14, 201, 245, 144, 23, 126, 104, 228, 0, 145, 2, | |
| 604 | - 13, 140, 244, 212, 17, 21, 20, 176, 159, 17, 95, 225, 160, 128, | |
| 605 | - 16, 1, 32, 224, 142, 32, 227, 125, 87, 64, 0, 16, 54, 129, | |
| 606 | - 205, 2, 141, 76, 53, 130, 103, 37, 166, 64, 144, 107, 78, 196, | |
| 607 | - 5, 192, 0, 54, 50, 229, 9, 141, 49, 84, 194, 35, 12, 196, | |
| 608 | - 153, 48, 192, 137, 57, 84, 24, 7, 87, 159, 249, 240, 215, 143, | |
| 609 | - 105, 241, 118, 149, 9, 139, 4, 64, 203, 141, 35, 140, 129, 131, | |
| 610 | - 16, 222, 125, 231, 128, 2, 238, 17, 152, 66, 3, 5, 56, 224, | |
| 611 | - 159, 103, 16, 76, 25, 75, 5, 11, 164, 215, 96, 9, 14, 16, | |
| 612 | - 36, 225, 15, 11, 40, 144, 192, 156, 41, 10, 178, 199, 3, 66, | |
| 613 | - 64, 80, 193, 3, 124, 90, 48, 129, 129, 102, 177, 18, 192, 154, | |
| 614 | - 49, 84, 240, 208, 92, 22, 149, 96, 39, 9, 31, 74, 17, 94, | |
| 615 | - 3, 8, 177, 199, 72, 59, 85, 76, 25, 216, 8, 139, 194, 197, | |
| 616 | - 138, 163, 69, 96, 115, 0, 147, 72, 72, 84, 28, 14, 79, 86, | |
| 617 | - 233, 230, 23, 113, 26, 160, 128, 3, 10, 58, 129, 103, 14, 159, | |
| 618 | - 214, 163, 146, 117, 238, 213, 154, 128, 151, 109, 84, 64, 217, 13, | |
| 619 | - 27, 10, 228, 39, 2, 235, 164, 168, 74, 8, 0, 59, | |
| 558 | + 71, 73, 70, 56, 55, 97, 62, 0, 71, 0, 244, 0, 0, 85, | |
| 559 | + 129, 149, 95, 136, 155, 99, 139, 157, 106, 144, 162, 113, 150, 166, | |
| 560 | + 116, 152, 168, 127, 160, 175, 138, 168, 182, 148, 176, 188, 159, 184, | |
| 561 | + 195, 170, 192, 202, 180, 199, 208, 184, 202, 210, 191, 207, 215, 201, | |
| 562 | + 215, 221, 212, 223, 228, 223, 231, 235, 226, 227, 226, 226, 234, 237, | |
| 563 | + 233, 239, 241, 240, 244, 246, 244, 247, 248, 255, 255, 255, 0, 0, | |
| 564 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 565 | + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, | |
| 566 | + 0, 0, 62, 0, 71, 0, 0, 5, 255, 96, 100, 141, 100, 105, | |
| 567 | + 158, 168, 37, 41, 132, 192, 164, 112, 44, 207, 102, 99, 0, 56, | |
| 568 | + 16, 84, 116, 239, 199, 141, 65, 110, 232, 248, 25, 141, 193, 161, | |
| 569 | + 82, 113, 108, 202, 32, 55, 229, 210, 73, 61, 41, 164, 88, 102, | |
| 570 | + 181, 10, 41, 96, 179, 91, 106, 35, 240, 5, 135, 143, 137, 242, | |
| 571 | + 87, 123, 246, 33, 190, 81, 108, 163, 237, 198, 14, 30, 113, 233, | |
| 572 | + 131, 78, 115, 72, 11, 115, 87, 101, 19, 124, 51, 66, 74, 8, | |
| 573 | + 19, 16, 67, 100, 74, 133, 50, 15, 101, 135, 56, 11, 74, 6, | |
| 574 | + 143, 49, 126, 106, 56, 8, 145, 67, 9, 152, 48, 139, 155, 5, | |
| 575 | + 22, 13, 74, 115, 161, 41, 147, 101, 13, 130, 57, 132, 170, 40, | |
| 576 | + 167, 155, 0, 94, 57, 3, 178, 48, 183, 181, 57, 160, 186, 40, | |
| 577 | + 19, 141, 189, 0, 69, 192, 40, 16, 195, 155, 185, 199, 41, 201, | |
| 578 | + 189, 191, 205, 193, 188, 131, 210, 49, 175, 88, 209, 214, 38, 19, | |
| 579 | + 3, 11, 19, 111, 127, 60, 219, 39, 55, 204, 19, 11, 6, 100, | |
| 580 | + 5, 10, 227, 228, 37, 163, 0, 239, 117, 56, 238, 243, 49, 195, | |
| 581 | + 177, 247, 48, 158, 56, 251, 50, 216, 254, 197, 56, 128, 107, 158, | |
| 582 | + 2, 125, 171, 114, 92, 218, 246, 96, 66, 3, 4, 50, 134, 176, | |
| 583 | + 145, 6, 97, 64, 144, 24, 19, 136, 108, 91, 177, 160, 0, 194, | |
| 584 | + 19, 253, 0, 216, 107, 214, 224, 192, 129, 5, 16, 83, 255, 244, | |
| 585 | + 43, 213, 195, 24, 159, 27, 169, 64, 230, 88, 208, 227, 129, 182, | |
| 586 | + 54, 4, 89, 158, 24, 181, 163, 199, 1, 155, 52, 233, 8, 130, | |
| 587 | + 176, 83, 24, 128, 137, 50, 18, 32, 48, 48, 114, 11, 173, 137, | |
| 588 | + 19, 110, 4, 64, 105, 1, 194, 30, 140, 68, 15, 24, 24, 224, | |
| 589 | + 50, 76, 70, 0, 11, 171, 54, 26, 160, 181, 194, 149, 148, 40, | |
| 590 | + 174, 148, 122, 64, 180, 208, 161, 17, 207, 112, 164, 1, 128, 96, | |
| 591 | + 148, 78, 18, 21, 194, 33, 229, 51, 247, 65, 133, 97, 5, 250, | |
| 592 | + 69, 229, 100, 34, 220, 128, 166, 116, 190, 62, 8, 167, 195, 170, | |
| 593 | + 47, 163, 0, 130, 90, 152, 11, 160, 173, 170, 27, 154, 26, 91, | |
| 594 | + 232, 151, 171, 18, 14, 162, 253, 98, 170, 18, 70, 171, 64, 219, | |
| 595 | + 10, 67, 136, 134, 187, 116, 75, 180, 46, 179, 174, 135, 4, 189, | |
| 596 | + 229, 231, 78, 40, 10, 62, 226, 164, 172, 64, 240, 167, 170, 10, | |
| 597 | + 18, 124, 188, 10, 107, 65, 193, 94, 11, 93, 171, 28, 248, 17, | |
| 598 | + 239, 46, 140, 78, 97, 34, 25, 153, 36, 99, 65, 130, 7, 203, | |
| 599 | + 183, 168, 51, 34, 136, 25, 140, 10, 6, 16, 28, 255, 145, 241, | |
| 600 | + 230, 140, 10, 66, 178, 167, 112, 48, 192, 128, 129, 9, 31, 141, | |
| 601 | + 84, 138, 63, 163, 162, 2, 203, 206, 240, 56, 55, 98, 192, 188, | |
| 602 | + 15, 185, 50, 160, 6, 0, 125, 62, 33, 214, 195, 33, 5, 24, | |
| 603 | + 184, 25, 231, 14, 201, 245, 144, 23, 126, 104, 228, 0, 145, 2, | |
| 604 | + 13, 140, 244, 212, 17, 21, 20, 176, 159, 17, 95, 225, 160, 128, | |
| 605 | + 16, 1, 32, 224, 142, 32, 227, 125, 87, 64, 0, 16, 54, 129, | |
| 606 | + 205, 2, 141, 76, 53, 130, 103, 37, 166, 64, 144, 107, 78, 196, | |
| 607 | + 5, 192, 0, 54, 50, 229, 9, 141, 49, 84, 194, 35, 12, 196, | |
| 608 | + 153, 48, 192, 137, 57, 84, 24, 7, 87, 159, 249, 240, 215, 143, | |
| 609 | + 105, 241, 118, 149, 9, 139, 4, 64, 203, 141, 35, 140, 129, 131, | |
| 610 | + 16, 222, 125, 231, 128, 2, 238, 17, 152, 66, 3, 5, 56, 224, | |
| 611 | + 159, 103, 16, 76, 25, 75, 5, 11, 164, 215, 96, 9, 14, 16, | |
| 612 | + 36, 225, 15, 11, 40, 144, 192, 156, 41, 10, 178, 199, 3, 66, | |
| 613 | + 64, 80, 193, 3, 124, 90, 48, 129, 129, 102, 177, 18, 192, 154, | |
| 614 | + 49, 84, 240, 208, 92, 22, 149, 96, 39, 9, 31, 74, 17, 94, | |
| 615 | + 3, 8, 177, 199, 72, 59, 85, 76, 25, 216, 8, 139, 194, 197, | |
| 616 | + 138, 163, 69, 96, 115, 0, 147, 72, 72, 84, 28, 14, 79, 86, | |
| 617 | + 233, 230, 23, 113, 26, 160, 128, 3, 10, 58, 129, 103, 14, 159, | |
| 618 | + 214, 163, 146, 117, 238, 213, 154, 128, 151, 109, 84, 64, 217, 13, | |
| 619 | + 27, 10, 228, 39, 2, 235, 164, 168, 74, 8, 0, 59, | |
| 620 | 620 | }; |
| 621 | 621 | |
| 622 | 622 | /* |
| 623 | 623 | ** WEBPAGE: logo |
| 624 | 624 | ** |
| 625 | 625 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -26,11 +26,11 @@ | |
| 26 | ** Try to guess the mimetype from content. |
| 27 | ** |
| 28 | ** If the content is pure text, return NULL. |
| 29 | ** |
| 30 | ** For image types, attempt to return an appropriate mimetype |
| 31 | ** name like "image/gif" or "image/jpeg". |
| 32 | ** |
| 33 | ** For any other binary type, return "unknown/unknown". |
| 34 | */ |
| 35 | const char *mimetype_from_content(Blob *pBlob){ |
| 36 | int i; |
| @@ -83,11 +83,11 @@ | |
| 83 | int i; |
| 84 | int first, last; |
| 85 | int len; |
| 86 | char zSuffix[20]; |
| 87 | |
| 88 | /* A table of mimetypes based on file suffixes. |
| 89 | ** Suffixes must be in sorted order so that we can do a binary |
| 90 | ** search to find the mime-type |
| 91 | */ |
| 92 | static const struct { |
| 93 | const char *zSuffix; /* The file suffix */ |
| @@ -487,11 +487,11 @@ | |
| 487 | db_end_transaction(0); |
| 488 | } |
| 489 | blob_to_utf8_no_bom(&filebody, 0); |
| 490 | |
| 491 | /* The file is now contained in the filebody blob. Deliver the |
| 492 | ** file to the user |
| 493 | */ |
| 494 | zMime = P("mimetype"); |
| 495 | if( zMime==0 ){ |
| 496 | zMime = mimetype_from_name(zName); |
| 497 | } |
| @@ -546,79 +546,79 @@ | |
| 546 | /* Jump here when unable to locate the document */ |
| 547 | db_end_transaction(0); |
| 548 | style_header("Document Not Found"); |
| 549 | @ <p>No such document: %h(zName)</p> |
| 550 | style_footer(); |
| 551 | return; |
| 552 | } |
| 553 | |
| 554 | /* |
| 555 | ** The default logo. |
| 556 | */ |
| 557 | static const unsigned char aLogo[] = { |
| 558 | 71, 73, 70, 56, 55, 97, 62, 0, 71, 0, 244, 0, 0, 85, |
| 559 | 129, 149, 95, 136, 155, 99, 139, 157, 106, 144, 162, 113, 150, 166, |
| 560 | 116, 152, 168, 127, 160, 175, 138, 168, 182, 148, 176, 188, 159, 184, |
| 561 | 195, 170, 192, 202, 180, 199, 208, 184, 202, 210, 191, 207, 215, 201, |
| 562 | 215, 221, 212, 223, 228, 223, 231, 235, 226, 227, 226, 226, 234, 237, |
| 563 | 233, 239, 241, 240, 244, 246, 244, 247, 248, 255, 255, 255, 0, 0, |
| 564 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 565 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, |
| 566 | 0, 0, 62, 0, 71, 0, 0, 5, 255, 96, 100, 141, 100, 105, |
| 567 | 158, 168, 37, 41, 132, 192, 164, 112, 44, 207, 102, 99, 0, 56, |
| 568 | 16, 84, 116, 239, 199, 141, 65, 110, 232, 248, 25, 141, 193, 161, |
| 569 | 82, 113, 108, 202, 32, 55, 229, 210, 73, 61, 41, 164, 88, 102, |
| 570 | 181, 10, 41, 96, 179, 91, 106, 35, 240, 5, 135, 143, 137, 242, |
| 571 | 87, 123, 246, 33, 190, 81, 108, 163, 237, 198, 14, 30, 113, 233, |
| 572 | 131, 78, 115, 72, 11, 115, 87, 101, 19, 124, 51, 66, 74, 8, |
| 573 | 19, 16, 67, 100, 74, 133, 50, 15, 101, 135, 56, 11, 74, 6, |
| 574 | 143, 49, 126, 106, 56, 8, 145, 67, 9, 152, 48, 139, 155, 5, |
| 575 | 22, 13, 74, 115, 161, 41, 147, 101, 13, 130, 57, 132, 170, 40, |
| 576 | 167, 155, 0, 94, 57, 3, 178, 48, 183, 181, 57, 160, 186, 40, |
| 577 | 19, 141, 189, 0, 69, 192, 40, 16, 195, 155, 185, 199, 41, 201, |
| 578 | 189, 191, 205, 193, 188, 131, 210, 49, 175, 88, 209, 214, 38, 19, |
| 579 | 3, 11, 19, 111, 127, 60, 219, 39, 55, 204, 19, 11, 6, 100, |
| 580 | 5, 10, 227, 228, 37, 163, 0, 239, 117, 56, 238, 243, 49, 195, |
| 581 | 177, 247, 48, 158, 56, 251, 50, 216, 254, 197, 56, 128, 107, 158, |
| 582 | 2, 125, 171, 114, 92, 218, 246, 96, 66, 3, 4, 50, 134, 176, |
| 583 | 145, 6, 97, 64, 144, 24, 19, 136, 108, 91, 177, 160, 0, 194, |
| 584 | 19, 253, 0, 216, 107, 214, 224, 192, 129, 5, 16, 83, 255, 244, |
| 585 | 43, 213, 195, 24, 159, 27, 169, 64, 230, 88, 208, 227, 129, 182, |
| 586 | 54, 4, 89, 158, 24, 181, 163, 199, 1, 155, 52, 233, 8, 130, |
| 587 | 176, 83, 24, 128, 137, 50, 18, 32, 48, 48, 114, 11, 173, 137, |
| 588 | 19, 110, 4, 64, 105, 1, 194, 30, 140, 68, 15, 24, 24, 224, |
| 589 | 50, 76, 70, 0, 11, 171, 54, 26, 160, 181, 194, 149, 148, 40, |
| 590 | 174, 148, 122, 64, 180, 208, 161, 17, 207, 112, 164, 1, 128, 96, |
| 591 | 148, 78, 18, 21, 194, 33, 229, 51, 247, 65, 133, 97, 5, 250, |
| 592 | 69, 229, 100, 34, 220, 128, 166, 116, 190, 62, 8, 167, 195, 170, |
| 593 | 47, 163, 0, 130, 90, 152, 11, 160, 173, 170, 27, 154, 26, 91, |
| 594 | 232, 151, 171, 18, 14, 162, 253, 98, 170, 18, 70, 171, 64, 219, |
| 595 | 10, 67, 136, 134, 187, 116, 75, 180, 46, 179, 174, 135, 4, 189, |
| 596 | 229, 231, 78, 40, 10, 62, 226, 164, 172, 64, 240, 167, 170, 10, |
| 597 | 18, 124, 188, 10, 107, 65, 193, 94, 11, 93, 171, 28, 248, 17, |
| 598 | 239, 46, 140, 78, 97, 34, 25, 153, 36, 99, 65, 130, 7, 203, |
| 599 | 183, 168, 51, 34, 136, 25, 140, 10, 6, 16, 28, 255, 145, 241, |
| 600 | 230, 140, 10, 66, 178, 167, 112, 48, 192, 128, 129, 9, 31, 141, |
| 601 | 84, 138, 63, 163, 162, 2, 203, 206, 240, 56, 55, 98, 192, 188, |
| 602 | 15, 185, 50, 160, 6, 0, 125, 62, 33, 214, 195, 33, 5, 24, |
| 603 | 184, 25, 231, 14, 201, 245, 144, 23, 126, 104, 228, 0, 145, 2, |
| 604 | 13, 140, 244, 212, 17, 21, 20, 176, 159, 17, 95, 225, 160, 128, |
| 605 | 16, 1, 32, 224, 142, 32, 227, 125, 87, 64, 0, 16, 54, 129, |
| 606 | 205, 2, 141, 76, 53, 130, 103, 37, 166, 64, 144, 107, 78, 196, |
| 607 | 5, 192, 0, 54, 50, 229, 9, 141, 49, 84, 194, 35, 12, 196, |
| 608 | 153, 48, 192, 137, 57, 84, 24, 7, 87, 159, 249, 240, 215, 143, |
| 609 | 105, 241, 118, 149, 9, 139, 4, 64, 203, 141, 35, 140, 129, 131, |
| 610 | 16, 222, 125, 231, 128, 2, 238, 17, 152, 66, 3, 5, 56, 224, |
| 611 | 159, 103, 16, 76, 25, 75, 5, 11, 164, 215, 96, 9, 14, 16, |
| 612 | 36, 225, 15, 11, 40, 144, 192, 156, 41, 10, 178, 199, 3, 66, |
| 613 | 64, 80, 193, 3, 124, 90, 48, 129, 129, 102, 177, 18, 192, 154, |
| 614 | 49, 84, 240, 208, 92, 22, 149, 96, 39, 9, 31, 74, 17, 94, |
| 615 | 3, 8, 177, 199, 72, 59, 85, 76, 25, 216, 8, 139, 194, 197, |
| 616 | 138, 163, 69, 96, 115, 0, 147, 72, 72, 84, 28, 14, 79, 86, |
| 617 | 233, 230, 23, 113, 26, 160, 128, 3, 10, 58, 129, 103, 14, 159, |
| 618 | 214, 163, 146, 117, 238, 213, 154, 128, 151, 109, 84, 64, 217, 13, |
| 619 | 27, 10, 228, 39, 2, 235, 164, 168, 74, 8, 0, 59, |
| 620 | }; |
| 621 | |
| 622 | /* |
| 623 | ** WEBPAGE: logo |
| 624 | ** |
| 625 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -26,11 +26,11 @@ | |
| 26 | ** Try to guess the mimetype from content. |
| 27 | ** |
| 28 | ** If the content is pure text, return NULL. |
| 29 | ** |
| 30 | ** For image types, attempt to return an appropriate mimetype |
| 31 | ** name like "image/gif" or "image/jpeg". |
| 32 | ** |
| 33 | ** For any other binary type, return "unknown/unknown". |
| 34 | */ |
| 35 | const char *mimetype_from_content(Blob *pBlob){ |
| 36 | int i; |
| @@ -83,11 +83,11 @@ | |
| 83 | int i; |
| 84 | int first, last; |
| 85 | int len; |
| 86 | char zSuffix[20]; |
| 87 | |
| 88 | /* A table of mimetypes based on file suffixes. |
| 89 | ** Suffixes must be in sorted order so that we can do a binary |
| 90 | ** search to find the mime-type |
| 91 | */ |
| 92 | static const struct { |
| 93 | const char *zSuffix; /* The file suffix */ |
| @@ -487,11 +487,11 @@ | |
| 487 | db_end_transaction(0); |
| 488 | } |
| 489 | blob_to_utf8_no_bom(&filebody, 0); |
| 490 | |
| 491 | /* The file is now contained in the filebody blob. Deliver the |
| 492 | ** file to the user |
| 493 | */ |
| 494 | zMime = P("mimetype"); |
| 495 | if( zMime==0 ){ |
| 496 | zMime = mimetype_from_name(zName); |
| 497 | } |
| @@ -546,79 +546,79 @@ | |
| 546 | /* Jump here when unable to locate the document */ |
| 547 | db_end_transaction(0); |
| 548 | style_header("Document Not Found"); |
| 549 | @ <p>No such document: %h(zName)</p> |
| 550 | style_footer(); |
| 551 | return; |
| 552 | } |
| 553 | |
| 554 | /* |
| 555 | ** The default logo. |
| 556 | */ |
| 557 | static const unsigned char aLogo[] = { |
| 558 | 71, 73, 70, 56, 55, 97, 62, 0, 71, 0, 244, 0, 0, 85, |
| 559 | 129, 149, 95, 136, 155, 99, 139, 157, 106, 144, 162, 113, 150, 166, |
| 560 | 116, 152, 168, 127, 160, 175, 138, 168, 182, 148, 176, 188, 159, 184, |
| 561 | 195, 170, 192, 202, 180, 199, 208, 184, 202, 210, 191, 207, 215, 201, |
| 562 | 215, 221, 212, 223, 228, 223, 231, 235, 226, 227, 226, 226, 234, 237, |
| 563 | 233, 239, 241, 240, 244, 246, 244, 247, 248, 255, 255, 255, 0, 0, |
| 564 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 565 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, |
| 566 | 0, 0, 62, 0, 71, 0, 0, 5, 255, 96, 100, 141, 100, 105, |
| 567 | 158, 168, 37, 41, 132, 192, 164, 112, 44, 207, 102, 99, 0, 56, |
| 568 | 16, 84, 116, 239, 199, 141, 65, 110, 232, 248, 25, 141, 193, 161, |
| 569 | 82, 113, 108, 202, 32, 55, 229, 210, 73, 61, 41, 164, 88, 102, |
| 570 | 181, 10, 41, 96, 179, 91, 106, 35, 240, 5, 135, 143, 137, 242, |
| 571 | 87, 123, 246, 33, 190, 81, 108, 163, 237, 198, 14, 30, 113, 233, |
| 572 | 131, 78, 115, 72, 11, 115, 87, 101, 19, 124, 51, 66, 74, 8, |
| 573 | 19, 16, 67, 100, 74, 133, 50, 15, 101, 135, 56, 11, 74, 6, |
| 574 | 143, 49, 126, 106, 56, 8, 145, 67, 9, 152, 48, 139, 155, 5, |
| 575 | 22, 13, 74, 115, 161, 41, 147, 101, 13, 130, 57, 132, 170, 40, |
| 576 | 167, 155, 0, 94, 57, 3, 178, 48, 183, 181, 57, 160, 186, 40, |
| 577 | 19, 141, 189, 0, 69, 192, 40, 16, 195, 155, 185, 199, 41, 201, |
| 578 | 189, 191, 205, 193, 188, 131, 210, 49, 175, 88, 209, 214, 38, 19, |
| 579 | 3, 11, 19, 111, 127, 60, 219, 39, 55, 204, 19, 11, 6, 100, |
| 580 | 5, 10, 227, 228, 37, 163, 0, 239, 117, 56, 238, 243, 49, 195, |
| 581 | 177, 247, 48, 158, 56, 251, 50, 216, 254, 197, 56, 128, 107, 158, |
| 582 | 2, 125, 171, 114, 92, 218, 246, 96, 66, 3, 4, 50, 134, 176, |
| 583 | 145, 6, 97, 64, 144, 24, 19, 136, 108, 91, 177, 160, 0, 194, |
| 584 | 19, 253, 0, 216, 107, 214, 224, 192, 129, 5, 16, 83, 255, 244, |
| 585 | 43, 213, 195, 24, 159, 27, 169, 64, 230, 88, 208, 227, 129, 182, |
| 586 | 54, 4, 89, 158, 24, 181, 163, 199, 1, 155, 52, 233, 8, 130, |
| 587 | 176, 83, 24, 128, 137, 50, 18, 32, 48, 48, 114, 11, 173, 137, |
| 588 | 19, 110, 4, 64, 105, 1, 194, 30, 140, 68, 15, 24, 24, 224, |
| 589 | 50, 76, 70, 0, 11, 171, 54, 26, 160, 181, 194, 149, 148, 40, |
| 590 | 174, 148, 122, 64, 180, 208, 161, 17, 207, 112, 164, 1, 128, 96, |
| 591 | 148, 78, 18, 21, 194, 33, 229, 51, 247, 65, 133, 97, 5, 250, |
| 592 | 69, 229, 100, 34, 220, 128, 166, 116, 190, 62, 8, 167, 195, 170, |
| 593 | 47, 163, 0, 130, 90, 152, 11, 160, 173, 170, 27, 154, 26, 91, |
| 594 | 232, 151, 171, 18, 14, 162, 253, 98, 170, 18, 70, 171, 64, 219, |
| 595 | 10, 67, 136, 134, 187, 116, 75, 180, 46, 179, 174, 135, 4, 189, |
| 596 | 229, 231, 78, 40, 10, 62, 226, 164, 172, 64, 240, 167, 170, 10, |
| 597 | 18, 124, 188, 10, 107, 65, 193, 94, 11, 93, 171, 28, 248, 17, |
| 598 | 239, 46, 140, 78, 97, 34, 25, 153, 36, 99, 65, 130, 7, 203, |
| 599 | 183, 168, 51, 34, 136, 25, 140, 10, 6, 16, 28, 255, 145, 241, |
| 600 | 230, 140, 10, 66, 178, 167, 112, 48, 192, 128, 129, 9, 31, 141, |
| 601 | 84, 138, 63, 163, 162, 2, 203, 206, 240, 56, 55, 98, 192, 188, |
| 602 | 15, 185, 50, 160, 6, 0, 125, 62, 33, 214, 195, 33, 5, 24, |
| 603 | 184, 25, 231, 14, 201, 245, 144, 23, 126, 104, 228, 0, 145, 2, |
| 604 | 13, 140, 244, 212, 17, 21, 20, 176, 159, 17, 95, 225, 160, 128, |
| 605 | 16, 1, 32, 224, 142, 32, 227, 125, 87, 64, 0, 16, 54, 129, |
| 606 | 205, 2, 141, 76, 53, 130, 103, 37, 166, 64, 144, 107, 78, 196, |
| 607 | 5, 192, 0, 54, 50, 229, 9, 141, 49, 84, 194, 35, 12, 196, |
| 608 | 153, 48, 192, 137, 57, 84, 24, 7, 87, 159, 249, 240, 215, 143, |
| 609 | 105, 241, 118, 149, 9, 139, 4, 64, 203, 141, 35, 140, 129, 131, |
| 610 | 16, 222, 125, 231, 128, 2, 238, 17, 152, 66, 3, 5, 56, 224, |
| 611 | 159, 103, 16, 76, 25, 75, 5, 11, 164, 215, 96, 9, 14, 16, |
| 612 | 36, 225, 15, 11, 40, 144, 192, 156, 41, 10, 178, 199, 3, 66, |
| 613 | 64, 80, 193, 3, 124, 90, 48, 129, 129, 102, 177, 18, 192, 154, |
| 614 | 49, 84, 240, 208, 92, 22, 149, 96, 39, 9, 31, 74, 17, 94, |
| 615 | 3, 8, 177, 199, 72, 59, 85, 76, 25, 216, 8, 139, 194, 197, |
| 616 | 138, 163, 69, 96, 115, 0, 147, 72, 72, 84, 28, 14, 79, 86, |
| 617 | 233, 230, 23, 113, 26, 160, 128, 3, 10, 58, 129, 103, 14, 159, |
| 618 | 214, 163, 146, 117, 238, 213, 154, 128, 151, 109, 84, 64, 217, 13, |
| 619 | 27, 10, 228, 39, 2, 235, 164, 168, 74, 8, 0, 59, |
| 620 | }; |
| 621 | |
| 622 | /* |
| 623 | ** WEBPAGE: logo |
| 624 | ** |
| 625 |
+27
-27
| --- src/encode.c | ||
| +++ src/encode.c | ||
| @@ -47,30 +47,30 @@ | ||
| 47 | 47 | } |
| 48 | 48 | i = 0; |
| 49 | 49 | zOut = fossil_malloc( count+1 ); |
| 50 | 50 | while( n-->0 && (c = *zIn)!=0 ){ |
| 51 | 51 | switch( c ){ |
| 52 | - case '<': | |
| 52 | + case '<': | |
| 53 | 53 | zOut[i++] = '&'; |
| 54 | 54 | zOut[i++] = 'l'; |
| 55 | 55 | zOut[i++] = 't'; |
| 56 | 56 | zOut[i++] = ';'; |
| 57 | 57 | break; |
| 58 | - case '>': | |
| 58 | + case '>': | |
| 59 | 59 | zOut[i++] = '&'; |
| 60 | 60 | zOut[i++] = 'g'; |
| 61 | 61 | zOut[i++] = 't'; |
| 62 | 62 | zOut[i++] = ';'; |
| 63 | 63 | break; |
| 64 | - case '&': | |
| 64 | + case '&': | |
| 65 | 65 | zOut[i++] = '&'; |
| 66 | 66 | zOut[i++] = 'a'; |
| 67 | 67 | zOut[i++] = 'm'; |
| 68 | 68 | zOut[i++] = 'p'; |
| 69 | 69 | zOut[i++] = ';'; |
| 70 | 70 | break; |
| 71 | - case '"': | |
| 71 | + case '"': | |
| 72 | 72 | zOut[i++] = '&'; |
| 73 | 73 | zOut[i++] = 'q'; |
| 74 | 74 | zOut[i++] = 'u'; |
| 75 | 75 | zOut[i++] = 'o'; |
| 76 | 76 | zOut[i++] = 't'; |
| @@ -181,11 +181,11 @@ | ||
| 181 | 181 | /* |
| 182 | 182 | ** Convert the input string into a form that is suitable for use as |
| 183 | 183 | ** a token in the HTTP protocol. Spaces are encoded as '+' and special |
| 184 | 184 | ** characters are encoded as "%HH" where HH is a two-digit hexidecimal |
| 185 | 185 | ** representation of the character. The "/" character is not encoded |
| 186 | -** by this routine. | |
| 186 | +** by this routine. | |
| 187 | 187 | */ |
| 188 | 188 | char *urlize(const char *z, int n){ |
| 189 | 189 | return EncodeHttp(z, n, 0); |
| 190 | 190 | } |
| 191 | 191 | |
| @@ -327,11 +327,11 @@ | ||
| 327 | 327 | |
| 328 | 328 | |
| 329 | 329 | /* |
| 330 | 330 | ** The characters used for HTTP base64 encoding. |
| 331 | 331 | */ |
| 332 | -static unsigned char zBase[] = | |
| 332 | +static unsigned char zBase[] = | |
| 333 | 333 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
| 334 | 334 | |
| 335 | 335 | /* |
| 336 | 336 | ** Encode a string using a base-64 encoding. |
| 337 | 337 | ** The encoding can be reversed using the <b>decode64</b> function. |
| @@ -366,11 +366,11 @@ | ||
| 366 | 366 | z64[n] = 0; |
| 367 | 367 | return z64; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | /* |
| 371 | -** COMMAND: test-encode64 | |
| 371 | +** COMMAND: test-encode64 | |
| 372 | 372 | ** Usage: %fossil test-encode64 STRING |
| 373 | 373 | */ |
| 374 | 374 | void test_encode64_cmd(void){ |
| 375 | 375 | char *z; |
| 376 | 376 | int i; |
| @@ -431,11 +431,11 @@ | ||
| 431 | 431 | *pnByte = j; |
| 432 | 432 | return zData; |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | /* |
| 436 | -** COMMAND: test-decode64 | |
| 436 | +** COMMAND: test-decode64 | |
| 437 | 437 | ** Usage: %fossil test-decode64 STRING |
| 438 | 438 | */ |
| 439 | 439 | void test_decode64_cmd(void){ |
| 440 | 440 | char *z; |
| 441 | 441 | int i, n; |
| @@ -454,11 +454,11 @@ | ||
| 454 | 454 | */ |
| 455 | 455 | |
| 456 | 456 | /* |
| 457 | 457 | ** The array used for encoding |
| 458 | 458 | */ /* 123456789 12345 */ |
| 459 | -static const char zEncode[] = "0123456789abcdef"; | |
| 459 | +static const char zEncode[] = "0123456789abcdef"; | |
| 460 | 460 | |
| 461 | 461 | /* |
| 462 | 462 | ** Encode a N-digit base-256 in base-16. Return zero on success |
| 463 | 463 | ** and non-zero if there is an error. |
| 464 | 464 | */ |
| @@ -473,33 +473,33 @@ | ||
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | /* |
| 476 | 476 | ** An array for translating single base-16 characters into a value. |
| 477 | 477 | ** Disallowed input characters have a value of 64. Upper and lower |
| 478 | -** case is the same. | |
| 478 | +** case is the same. | |
| 479 | 479 | */ |
| 480 | 480 | static const char zDecode[] = { |
| 481 | - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 482 | - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 483 | - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 484 | - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 64, 64, 64, 64, 64, 64, | |
| 481 | + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 482 | + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 483 | + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 484 | + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 64, 64, 64, 64, 64, 64, | |
| 485 | 485 | 64, 10, 11, 12, 13, 14, 15, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 486 | 486 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 487 | 487 | 64, 10, 11, 12, 13, 14, 15, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 488 | 488 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 489 | - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 490 | - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 491 | - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 492 | - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 493 | - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 494 | - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 495 | - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 496 | - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 489 | + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 490 | + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 491 | + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 492 | + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 493 | + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 494 | + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 495 | + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 496 | + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, | |
| 497 | 497 | }; |
| 498 | 498 | |
| 499 | 499 | /* |
| 500 | -** Decode a N-character base-16 number into base-256. N must be a | |
| 500 | +** Decode a N-character base-16 number into base-256. N must be a | |
| 501 | 501 | ** multiple of 2. The output buffer must be at least N/2 characters |
| 502 | 502 | ** in length |
| 503 | 503 | */ |
| 504 | 504 | int decode16(const unsigned char *zIn, unsigned char *pOut, int N){ |
| 505 | 505 | int i, j; |
| @@ -545,11 +545,11 @@ | ||
| 545 | 545 | /* Randomness used for XOR-ing by the obscure() and unobscure() routines */ |
| 546 | 546 | static const unsigned char aObscurer[16] = { |
| 547 | 547 | 0xa7, 0x21, 0x31, 0xe3, 0x2a, 0x50, 0x2c, 0x86, |
| 548 | 548 | 0x4c, 0xa4, 0x52, 0x25, 0xff, 0x49, 0x35, 0x85 |
| 549 | 549 | }; |
| 550 | - | |
| 550 | + | |
| 551 | 551 | |
| 552 | 552 | /* |
| 553 | 553 | ** Obscure plain text so that it is not easily readable. |
| 554 | 554 | ** |
| 555 | 555 | ** This is used for storing sensitive information (such as passwords) in a |
| @@ -562,11 +562,11 @@ | ||
| 562 | 562 | */ |
| 563 | 563 | char *obscure(const char *zIn){ |
| 564 | 564 | int n, i; |
| 565 | 565 | unsigned char salt; |
| 566 | 566 | char *zOut; |
| 567 | - | |
| 567 | + | |
| 568 | 568 | if( zIn==0 ) return 0; |
| 569 | 569 | n = strlen(zIn); |
| 570 | 570 | zOut = fossil_malloc( n*2+3 ); |
| 571 | 571 | sqlite3_randomness(1, &salt); |
| 572 | 572 | zOut[n+1] = (char)salt; |
| @@ -578,17 +578,17 @@ | ||
| 578 | 578 | /* |
| 579 | 579 | ** Undo the obscuring of text performed by obscure(). Or, if the input is |
| 580 | 580 | ** not hexadecimal (meaning the input is not the output of obscure()) then |
| 581 | 581 | ** do the equivalent of strdup(). |
| 582 | 582 | ** |
| 583 | -** The result is memory obtained from malloc that should be freed by the caller. | |
| 583 | +** The result is memory obtained from malloc that should be freed by the caller. | |
| 584 | 584 | */ |
| 585 | 585 | char *unobscure(const char *zIn){ |
| 586 | 586 | int n, i; |
| 587 | 587 | unsigned char salt; |
| 588 | 588 | char *zOut; |
| 589 | - | |
| 589 | + | |
| 590 | 590 | if( zIn==0 ) return 0; |
| 591 | 591 | n = strlen(zIn); |
| 592 | 592 | zOut = fossil_malloc( n + 1 ); |
| 593 | 593 | if( n<2 |
| 594 | 594 | || decode16((unsigned char*)zIn, &salt, 2) |
| 595 | 595 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -47,30 +47,30 @@ | |
| 47 | } |
| 48 | i = 0; |
| 49 | zOut = fossil_malloc( count+1 ); |
| 50 | while( n-->0 && (c = *zIn)!=0 ){ |
| 51 | switch( c ){ |
| 52 | case '<': |
| 53 | zOut[i++] = '&'; |
| 54 | zOut[i++] = 'l'; |
| 55 | zOut[i++] = 't'; |
| 56 | zOut[i++] = ';'; |
| 57 | break; |
| 58 | case '>': |
| 59 | zOut[i++] = '&'; |
| 60 | zOut[i++] = 'g'; |
| 61 | zOut[i++] = 't'; |
| 62 | zOut[i++] = ';'; |
| 63 | break; |
| 64 | case '&': |
| 65 | zOut[i++] = '&'; |
| 66 | zOut[i++] = 'a'; |
| 67 | zOut[i++] = 'm'; |
| 68 | zOut[i++] = 'p'; |
| 69 | zOut[i++] = ';'; |
| 70 | break; |
| 71 | case '"': |
| 72 | zOut[i++] = '&'; |
| 73 | zOut[i++] = 'q'; |
| 74 | zOut[i++] = 'u'; |
| 75 | zOut[i++] = 'o'; |
| 76 | zOut[i++] = 't'; |
| @@ -181,11 +181,11 @@ | |
| 181 | /* |
| 182 | ** Convert the input string into a form that is suitable for use as |
| 183 | ** a token in the HTTP protocol. Spaces are encoded as '+' and special |
| 184 | ** characters are encoded as "%HH" where HH is a two-digit hexidecimal |
| 185 | ** representation of the character. The "/" character is not encoded |
| 186 | ** by this routine. |
| 187 | */ |
| 188 | char *urlize(const char *z, int n){ |
| 189 | return EncodeHttp(z, n, 0); |
| 190 | } |
| 191 | |
| @@ -327,11 +327,11 @@ | |
| 327 | |
| 328 | |
| 329 | /* |
| 330 | ** The characters used for HTTP base64 encoding. |
| 331 | */ |
| 332 | static unsigned char zBase[] = |
| 333 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
| 334 | |
| 335 | /* |
| 336 | ** Encode a string using a base-64 encoding. |
| 337 | ** The encoding can be reversed using the <b>decode64</b> function. |
| @@ -366,11 +366,11 @@ | |
| 366 | z64[n] = 0; |
| 367 | return z64; |
| 368 | } |
| 369 | |
| 370 | /* |
| 371 | ** COMMAND: test-encode64 |
| 372 | ** Usage: %fossil test-encode64 STRING |
| 373 | */ |
| 374 | void test_encode64_cmd(void){ |
| 375 | char *z; |
| 376 | int i; |
| @@ -431,11 +431,11 @@ | |
| 431 | *pnByte = j; |
| 432 | return zData; |
| 433 | } |
| 434 | |
| 435 | /* |
| 436 | ** COMMAND: test-decode64 |
| 437 | ** Usage: %fossil test-decode64 STRING |
| 438 | */ |
| 439 | void test_decode64_cmd(void){ |
| 440 | char *z; |
| 441 | int i, n; |
| @@ -454,11 +454,11 @@ | |
| 454 | */ |
| 455 | |
| 456 | /* |
| 457 | ** The array used for encoding |
| 458 | */ /* 123456789 12345 */ |
| 459 | static const char zEncode[] = "0123456789abcdef"; |
| 460 | |
| 461 | /* |
| 462 | ** Encode a N-digit base-256 in base-16. Return zero on success |
| 463 | ** and non-zero if there is an error. |
| 464 | */ |
| @@ -473,33 +473,33 @@ | |
| 473 | } |
| 474 | |
| 475 | /* |
| 476 | ** An array for translating single base-16 characters into a value. |
| 477 | ** Disallowed input characters have a value of 64. Upper and lower |
| 478 | ** case is the same. |
| 479 | */ |
| 480 | static const char zDecode[] = { |
| 481 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 482 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 483 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 484 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 64, 64, 64, 64, 64, 64, |
| 485 | 64, 10, 11, 12, 13, 14, 15, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 486 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 487 | 64, 10, 11, 12, 13, 14, 15, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 488 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 489 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 490 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 491 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 492 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 493 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 494 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 495 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 496 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 497 | }; |
| 498 | |
| 499 | /* |
| 500 | ** Decode a N-character base-16 number into base-256. N must be a |
| 501 | ** multiple of 2. The output buffer must be at least N/2 characters |
| 502 | ** in length |
| 503 | */ |
| 504 | int decode16(const unsigned char *zIn, unsigned char *pOut, int N){ |
| 505 | int i, j; |
| @@ -545,11 +545,11 @@ | |
| 545 | /* Randomness used for XOR-ing by the obscure() and unobscure() routines */ |
| 546 | static const unsigned char aObscurer[16] = { |
| 547 | 0xa7, 0x21, 0x31, 0xe3, 0x2a, 0x50, 0x2c, 0x86, |
| 548 | 0x4c, 0xa4, 0x52, 0x25, 0xff, 0x49, 0x35, 0x85 |
| 549 | }; |
| 550 | |
| 551 | |
| 552 | /* |
| 553 | ** Obscure plain text so that it is not easily readable. |
| 554 | ** |
| 555 | ** This is used for storing sensitive information (such as passwords) in a |
| @@ -562,11 +562,11 @@ | |
| 562 | */ |
| 563 | char *obscure(const char *zIn){ |
| 564 | int n, i; |
| 565 | unsigned char salt; |
| 566 | char *zOut; |
| 567 | |
| 568 | if( zIn==0 ) return 0; |
| 569 | n = strlen(zIn); |
| 570 | zOut = fossil_malloc( n*2+3 ); |
| 571 | sqlite3_randomness(1, &salt); |
| 572 | zOut[n+1] = (char)salt; |
| @@ -578,17 +578,17 @@ | |
| 578 | /* |
| 579 | ** Undo the obscuring of text performed by obscure(). Or, if the input is |
| 580 | ** not hexadecimal (meaning the input is not the output of obscure()) then |
| 581 | ** do the equivalent of strdup(). |
| 582 | ** |
| 583 | ** The result is memory obtained from malloc that should be freed by the caller. |
| 584 | */ |
| 585 | char *unobscure(const char *zIn){ |
| 586 | int n, i; |
| 587 | unsigned char salt; |
| 588 | char *zOut; |
| 589 | |
| 590 | if( zIn==0 ) return 0; |
| 591 | n = strlen(zIn); |
| 592 | zOut = fossil_malloc( n + 1 ); |
| 593 | if( n<2 |
| 594 | || decode16((unsigned char*)zIn, &salt, 2) |
| 595 |
| --- src/encode.c | |
| +++ src/encode.c | |
| @@ -47,30 +47,30 @@ | |
| 47 | } |
| 48 | i = 0; |
| 49 | zOut = fossil_malloc( count+1 ); |
| 50 | while( n-->0 && (c = *zIn)!=0 ){ |
| 51 | switch( c ){ |
| 52 | case '<': |
| 53 | zOut[i++] = '&'; |
| 54 | zOut[i++] = 'l'; |
| 55 | zOut[i++] = 't'; |
| 56 | zOut[i++] = ';'; |
| 57 | break; |
| 58 | case '>': |
| 59 | zOut[i++] = '&'; |
| 60 | zOut[i++] = 'g'; |
| 61 | zOut[i++] = 't'; |
| 62 | zOut[i++] = ';'; |
| 63 | break; |
| 64 | case '&': |
| 65 | zOut[i++] = '&'; |
| 66 | zOut[i++] = 'a'; |
| 67 | zOut[i++] = 'm'; |
| 68 | zOut[i++] = 'p'; |
| 69 | zOut[i++] = ';'; |
| 70 | break; |
| 71 | case '"': |
| 72 | zOut[i++] = '&'; |
| 73 | zOut[i++] = 'q'; |
| 74 | zOut[i++] = 'u'; |
| 75 | zOut[i++] = 'o'; |
| 76 | zOut[i++] = 't'; |
| @@ -181,11 +181,11 @@ | |
| 181 | /* |
| 182 | ** Convert the input string into a form that is suitable for use as |
| 183 | ** a token in the HTTP protocol. Spaces are encoded as '+' and special |
| 184 | ** characters are encoded as "%HH" where HH is a two-digit hexidecimal |
| 185 | ** representation of the character. The "/" character is not encoded |
| 186 | ** by this routine. |
| 187 | */ |
| 188 | char *urlize(const char *z, int n){ |
| 189 | return EncodeHttp(z, n, 0); |
| 190 | } |
| 191 | |
| @@ -327,11 +327,11 @@ | |
| 327 | |
| 328 | |
| 329 | /* |
| 330 | ** The characters used for HTTP base64 encoding. |
| 331 | */ |
| 332 | static unsigned char zBase[] = |
| 333 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
| 334 | |
| 335 | /* |
| 336 | ** Encode a string using a base-64 encoding. |
| 337 | ** The encoding can be reversed using the <b>decode64</b> function. |
| @@ -366,11 +366,11 @@ | |
| 366 | z64[n] = 0; |
| 367 | return z64; |
| 368 | } |
| 369 | |
| 370 | /* |
| 371 | ** COMMAND: test-encode64 |
| 372 | ** Usage: %fossil test-encode64 STRING |
| 373 | */ |
| 374 | void test_encode64_cmd(void){ |
| 375 | char *z; |
| 376 | int i; |
| @@ -431,11 +431,11 @@ | |
| 431 | *pnByte = j; |
| 432 | return zData; |
| 433 | } |
| 434 | |
| 435 | /* |
| 436 | ** COMMAND: test-decode64 |
| 437 | ** Usage: %fossil test-decode64 STRING |
| 438 | */ |
| 439 | void test_decode64_cmd(void){ |
| 440 | char *z; |
| 441 | int i, n; |
| @@ -454,11 +454,11 @@ | |
| 454 | */ |
| 455 | |
| 456 | /* |
| 457 | ** The array used for encoding |
| 458 | */ /* 123456789 12345 */ |
| 459 | static const char zEncode[] = "0123456789abcdef"; |
| 460 | |
| 461 | /* |
| 462 | ** Encode a N-digit base-256 in base-16. Return zero on success |
| 463 | ** and non-zero if there is an error. |
| 464 | */ |
| @@ -473,33 +473,33 @@ | |
| 473 | } |
| 474 | |
| 475 | /* |
| 476 | ** An array for translating single base-16 characters into a value. |
| 477 | ** Disallowed input characters have a value of 64. Upper and lower |
| 478 | ** case is the same. |
| 479 | */ |
| 480 | static const char zDecode[] = { |
| 481 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 482 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 483 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 484 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 64, 64, 64, 64, 64, 64, |
| 485 | 64, 10, 11, 12, 13, 14, 15, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 486 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 487 | 64, 10, 11, 12, 13, 14, 15, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 488 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 489 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 490 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 491 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 492 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 493 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 494 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 495 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 496 | 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, |
| 497 | }; |
| 498 | |
| 499 | /* |
| 500 | ** Decode a N-character base-16 number into base-256. N must be a |
| 501 | ** multiple of 2. The output buffer must be at least N/2 characters |
| 502 | ** in length |
| 503 | */ |
| 504 | int decode16(const unsigned char *zIn, unsigned char *pOut, int N){ |
| 505 | int i, j; |
| @@ -545,11 +545,11 @@ | |
| 545 | /* Randomness used for XOR-ing by the obscure() and unobscure() routines */ |
| 546 | static const unsigned char aObscurer[16] = { |
| 547 | 0xa7, 0x21, 0x31, 0xe3, 0x2a, 0x50, 0x2c, 0x86, |
| 548 | 0x4c, 0xa4, 0x52, 0x25, 0xff, 0x49, 0x35, 0x85 |
| 549 | }; |
| 550 | |
| 551 | |
| 552 | /* |
| 553 | ** Obscure plain text so that it is not easily readable. |
| 554 | ** |
| 555 | ** This is used for storing sensitive information (such as passwords) in a |
| @@ -562,11 +562,11 @@ | |
| 562 | */ |
| 563 | char *obscure(const char *zIn){ |
| 564 | int n, i; |
| 565 | unsigned char salt; |
| 566 | char *zOut; |
| 567 | |
| 568 | if( zIn==0 ) return 0; |
| 569 | n = strlen(zIn); |
| 570 | zOut = fossil_malloc( n*2+3 ); |
| 571 | sqlite3_randomness(1, &salt); |
| 572 | zOut[n+1] = (char)salt; |
| @@ -578,17 +578,17 @@ | |
| 578 | /* |
| 579 | ** Undo the obscuring of text performed by obscure(). Or, if the input is |
| 580 | ** not hexadecimal (meaning the input is not the output of obscure()) then |
| 581 | ** do the equivalent of strdup(). |
| 582 | ** |
| 583 | ** The result is memory obtained from malloc that should be freed by the caller. |
| 584 | */ |
| 585 | char *unobscure(const char *zIn){ |
| 586 | int n, i; |
| 587 | unsigned char salt; |
| 588 | char *zOut; |
| 589 | |
| 590 | if( zIn==0 ) return 0; |
| 591 | n = strlen(zIn); |
| 592 | zOut = fossil_malloc( n + 1 ); |
| 593 | if( n<2 |
| 594 | || decode16((unsigned char*)zIn, &salt, 2) |
| 595 |
+9
-9
| --- src/path.c | ||
| +++ src/path.c | ||
| @@ -112,11 +112,11 @@ | ||
| 112 | 112 | ** Compute the shortest path from iFrom to iTo |
| 113 | 113 | ** |
| 114 | 114 | ** If directOnly is true, then use only the "primary" links from parent to |
| 115 | 115 | ** child. In other words, ignore merges. |
| 116 | 116 | ** |
| 117 | -** Return a pointer to the beginning of the path (the iFrom node). | |
| 117 | +** Return a pointer to the beginning of the path (the iFrom node). | |
| 118 | 118 | ** Elements of the path can be traversed by following the PathNode.u.pTo |
| 119 | 119 | ** pointer chain. |
| 120 | 120 | ** |
| 121 | 121 | ** Return NULL if no path is found. |
| 122 | 122 | */ |
| @@ -135,25 +135,25 @@ | ||
| 135 | 135 | if( iTo==iFrom ){ |
| 136 | 136 | path.pEnd = path.pStart; |
| 137 | 137 | return path.pStart; |
| 138 | 138 | } |
| 139 | 139 | if( oneWayOnly && directOnly ){ |
| 140 | - db_prepare(&s, | |
| 140 | + db_prepare(&s, | |
| 141 | 141 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim" |
| 142 | 142 | ); |
| 143 | 143 | }else if( oneWayOnly ){ |
| 144 | - db_prepare(&s, | |
| 144 | + db_prepare(&s, | |
| 145 | 145 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 146 | 146 | ); |
| 147 | 147 | }else if( directOnly ){ |
| 148 | - db_prepare(&s, | |
| 148 | + db_prepare(&s, | |
| 149 | 149 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim " |
| 150 | 150 | "UNION ALL " |
| 151 | 151 | "SELECT pid, 0 FROM plink WHERE cid=:pid AND isprim" |
| 152 | 152 | ); |
| 153 | 153 | }else{ |
| 154 | - db_prepare(&s, | |
| 154 | + db_prepare(&s, | |
| 155 | 155 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 156 | 156 | "UNION ALL " |
| 157 | 157 | "SELECT pid, 0 FROM plink WHERE cid=:pid" |
| 158 | 158 | ); |
| 159 | 159 | } |
| @@ -230,11 +230,11 @@ | ||
| 230 | 230 | " WHERE blob.rid=%d AND event.objid=%d AND event.type='ci'", |
| 231 | 231 | p->rid, p->rid); |
| 232 | 232 | fossil_print("%4d: %5d %s", n, p->rid, z); |
| 233 | 233 | fossil_free(z); |
| 234 | 234 | if( p->u.pTo ){ |
| 235 | - fossil_print(" is a %s of\n", | |
| 235 | + fossil_print(" is a %s of\n", | |
| 236 | 236 | p->u.pTo->fromIsParent ? "parent" : "child"); |
| 237 | 237 | }else{ |
| 238 | 238 | fossil_print("\n"); |
| 239 | 239 | } |
| 240 | 240 | } |
| @@ -353,11 +353,11 @@ | ||
| 353 | 353 | /* |
| 354 | 354 | ** Compute all file name changes that occur going from checkin iFrom |
| 355 | 355 | ** to checkin iTo. |
| 356 | 356 | ** |
| 357 | 357 | ** The number of name changes is written into *pnChng. For each name |
| 358 | -** change, two integers are allocated for *piChng. The first is the | |
| 358 | +** change, two integers are allocated for *piChng. The first is the | |
| 359 | 359 | ** filename.fnid for the original name as seen in check-in iFrom and |
| 360 | 360 | ** the second is for new name as it is used in check-in iTo. |
| 361 | 361 | ** |
| 362 | 362 | ** Space to hold *piChng is obtained from fossil_malloc() and should |
| 363 | 363 | ** be released by the caller. |
| @@ -516,11 +516,11 @@ | ||
| 516 | 516 | g.argc -= 2; |
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | /* Query to extract all rename operations */ |
| 521 | -static const char zRenameQuery[] = | |
| 521 | +static const char zRenameQuery[] = | |
| 522 | 522 | @ SELECT |
| 523 | 523 | @ datetime(event.mtime), |
| 524 | 524 | @ F.name AS old_name, |
| 525 | 525 | @ T.name AS new_name, |
| 526 | 526 | @ blob.uuid |
| @@ -531,11 +531,11 @@ | ||
| 531 | 531 | @ AND event.objid=mlink.mid |
| 532 | 532 | @ AND event.type='ci' |
| 533 | 533 | @ AND blob.rid=mlink.mid |
| 534 | 534 | @ ORDER BY 1 DESC, 2; |
| 535 | 535 | ; |
| 536 | - | |
| 536 | + | |
| 537 | 537 | /* |
| 538 | 538 | ** WEBPAGE: test-rename-list |
| 539 | 539 | ** |
| 540 | 540 | ** Print a list of all file rename operations throughout history. |
| 541 | 541 | ** This page is intended for for testing purposes only and may change |
| 542 | 542 |
| --- src/path.c | |
| +++ src/path.c | |
| @@ -112,11 +112,11 @@ | |
| 112 | ** Compute the shortest path from iFrom to iTo |
| 113 | ** |
| 114 | ** If directOnly is true, then use only the "primary" links from parent to |
| 115 | ** child. In other words, ignore merges. |
| 116 | ** |
| 117 | ** Return a pointer to the beginning of the path (the iFrom node). |
| 118 | ** Elements of the path can be traversed by following the PathNode.u.pTo |
| 119 | ** pointer chain. |
| 120 | ** |
| 121 | ** Return NULL if no path is found. |
| 122 | */ |
| @@ -135,25 +135,25 @@ | |
| 135 | if( iTo==iFrom ){ |
| 136 | path.pEnd = path.pStart; |
| 137 | return path.pStart; |
| 138 | } |
| 139 | if( oneWayOnly && directOnly ){ |
| 140 | db_prepare(&s, |
| 141 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim" |
| 142 | ); |
| 143 | }else if( oneWayOnly ){ |
| 144 | db_prepare(&s, |
| 145 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 146 | ); |
| 147 | }else if( directOnly ){ |
| 148 | db_prepare(&s, |
| 149 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim " |
| 150 | "UNION ALL " |
| 151 | "SELECT pid, 0 FROM plink WHERE cid=:pid AND isprim" |
| 152 | ); |
| 153 | }else{ |
| 154 | db_prepare(&s, |
| 155 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 156 | "UNION ALL " |
| 157 | "SELECT pid, 0 FROM plink WHERE cid=:pid" |
| 158 | ); |
| 159 | } |
| @@ -230,11 +230,11 @@ | |
| 230 | " WHERE blob.rid=%d AND event.objid=%d AND event.type='ci'", |
| 231 | p->rid, p->rid); |
| 232 | fossil_print("%4d: %5d %s", n, p->rid, z); |
| 233 | fossil_free(z); |
| 234 | if( p->u.pTo ){ |
| 235 | fossil_print(" is a %s of\n", |
| 236 | p->u.pTo->fromIsParent ? "parent" : "child"); |
| 237 | }else{ |
| 238 | fossil_print("\n"); |
| 239 | } |
| 240 | } |
| @@ -353,11 +353,11 @@ | |
| 353 | /* |
| 354 | ** Compute all file name changes that occur going from checkin iFrom |
| 355 | ** to checkin iTo. |
| 356 | ** |
| 357 | ** The number of name changes is written into *pnChng. For each name |
| 358 | ** change, two integers are allocated for *piChng. The first is the |
| 359 | ** filename.fnid for the original name as seen in check-in iFrom and |
| 360 | ** the second is for new name as it is used in check-in iTo. |
| 361 | ** |
| 362 | ** Space to hold *piChng is obtained from fossil_malloc() and should |
| 363 | ** be released by the caller. |
| @@ -516,11 +516,11 @@ | |
| 516 | g.argc -= 2; |
| 517 | } |
| 518 | } |
| 519 | |
| 520 | /* Query to extract all rename operations */ |
| 521 | static const char zRenameQuery[] = |
| 522 | @ SELECT |
| 523 | @ datetime(event.mtime), |
| 524 | @ F.name AS old_name, |
| 525 | @ T.name AS new_name, |
| 526 | @ blob.uuid |
| @@ -531,11 +531,11 @@ | |
| 531 | @ AND event.objid=mlink.mid |
| 532 | @ AND event.type='ci' |
| 533 | @ AND blob.rid=mlink.mid |
| 534 | @ ORDER BY 1 DESC, 2; |
| 535 | ; |
| 536 | |
| 537 | /* |
| 538 | ** WEBPAGE: test-rename-list |
| 539 | ** |
| 540 | ** Print a list of all file rename operations throughout history. |
| 541 | ** This page is intended for for testing purposes only and may change |
| 542 |
| --- src/path.c | |
| +++ src/path.c | |
| @@ -112,11 +112,11 @@ | |
| 112 | ** Compute the shortest path from iFrom to iTo |
| 113 | ** |
| 114 | ** If directOnly is true, then use only the "primary" links from parent to |
| 115 | ** child. In other words, ignore merges. |
| 116 | ** |
| 117 | ** Return a pointer to the beginning of the path (the iFrom node). |
| 118 | ** Elements of the path can be traversed by following the PathNode.u.pTo |
| 119 | ** pointer chain. |
| 120 | ** |
| 121 | ** Return NULL if no path is found. |
| 122 | */ |
| @@ -135,25 +135,25 @@ | |
| 135 | if( iTo==iFrom ){ |
| 136 | path.pEnd = path.pStart; |
| 137 | return path.pStart; |
| 138 | } |
| 139 | if( oneWayOnly && directOnly ){ |
| 140 | db_prepare(&s, |
| 141 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim" |
| 142 | ); |
| 143 | }else if( oneWayOnly ){ |
| 144 | db_prepare(&s, |
| 145 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 146 | ); |
| 147 | }else if( directOnly ){ |
| 148 | db_prepare(&s, |
| 149 | "SELECT cid, 1 FROM plink WHERE pid=:pid AND isprim " |
| 150 | "UNION ALL " |
| 151 | "SELECT pid, 0 FROM plink WHERE cid=:pid AND isprim" |
| 152 | ); |
| 153 | }else{ |
| 154 | db_prepare(&s, |
| 155 | "SELECT cid, 1 FROM plink WHERE pid=:pid " |
| 156 | "UNION ALL " |
| 157 | "SELECT pid, 0 FROM plink WHERE cid=:pid" |
| 158 | ); |
| 159 | } |
| @@ -230,11 +230,11 @@ | |
| 230 | " WHERE blob.rid=%d AND event.objid=%d AND event.type='ci'", |
| 231 | p->rid, p->rid); |
| 232 | fossil_print("%4d: %5d %s", n, p->rid, z); |
| 233 | fossil_free(z); |
| 234 | if( p->u.pTo ){ |
| 235 | fossil_print(" is a %s of\n", |
| 236 | p->u.pTo->fromIsParent ? "parent" : "child"); |
| 237 | }else{ |
| 238 | fossil_print("\n"); |
| 239 | } |
| 240 | } |
| @@ -353,11 +353,11 @@ | |
| 353 | /* |
| 354 | ** Compute all file name changes that occur going from checkin iFrom |
| 355 | ** to checkin iTo. |
| 356 | ** |
| 357 | ** The number of name changes is written into *pnChng. For each name |
| 358 | ** change, two integers are allocated for *piChng. The first is the |
| 359 | ** filename.fnid for the original name as seen in check-in iFrom and |
| 360 | ** the second is for new name as it is used in check-in iTo. |
| 361 | ** |
| 362 | ** Space to hold *piChng is obtained from fossil_malloc() and should |
| 363 | ** be released by the caller. |
| @@ -516,11 +516,11 @@ | |
| 516 | g.argc -= 2; |
| 517 | } |
| 518 | } |
| 519 | |
| 520 | /* Query to extract all rename operations */ |
| 521 | static const char zRenameQuery[] = |
| 522 | @ SELECT |
| 523 | @ datetime(event.mtime), |
| 524 | @ F.name AS old_name, |
| 525 | @ T.name AS new_name, |
| 526 | @ blob.uuid |
| @@ -531,11 +531,11 @@ | |
| 531 | @ AND event.objid=mlink.mid |
| 532 | @ AND event.type='ci' |
| 533 | @ AND blob.rid=mlink.mid |
| 534 | @ ORDER BY 1 DESC, 2; |
| 535 | ; |
| 536 | |
| 537 | /* |
| 538 | ** WEBPAGE: test-rename-list |
| 539 | ** |
| 540 | ** Print a list of all file rename operations throughout history. |
| 541 | ** This page is intended for for testing purposes only and may change |
| 542 |
+7
-7
| --- src/translate.c | ||
| +++ src/translate.c | ||
| @@ -13,11 +13,11 @@ | ||
| 13 | 13 | ** [email protected] |
| 14 | 14 | ** http://www.hwaci.com/drh/ |
| 15 | 15 | ** |
| 16 | 16 | ******************************************************************************* |
| 17 | 17 | ** |
| 18 | -** SYNOPSIS: | |
| 18 | +** SYNOPSIS: | |
| 19 | 19 | ** |
| 20 | 20 | ** Input lines that begin with the "@" character are translated into |
| 21 | 21 | ** either cgi_printf() statements or string literals and the |
| 22 | 22 | ** translated code is written on standard output. |
| 23 | 23 | ** |
| @@ -34,22 +34,22 @@ | ||
| 34 | 34 | ** punctuation. |
| 35 | 35 | ** |
| 36 | 36 | ** Enhancement #1: |
| 37 | 37 | ** |
| 38 | 38 | ** If the last non-whitespace character prior to the first "@" of a |
| 39 | -** @-block is "=" or "," then the @-block is a string literal initializer | |
| 39 | +** @-block is "=" or "," then the @-block is a string literal initializer | |
| 40 | 40 | ** rather than text that is to be output via cgi_printf(). Render it |
| 41 | 41 | ** as such. |
| 42 | 42 | ** |
| 43 | 43 | ** Enhancement #2: |
| 44 | 44 | ** |
| 45 | -** Comments of the form: "/* @-comment: CC" cause CC to become a | |
| 45 | +** Comments of the form: "/* @-comment: CC" cause CC to become a | |
| 46 | 46 | ** comment character for the @-substitution. Typical values for CC are |
| 47 | 47 | ** "--" (for SQL text) or "#" (for TCL script) or "//" (for C++ code). |
| 48 | 48 | ** Lines of subsequent @-blocks that begin with CC are omitted from the |
| 49 | 49 | ** output. |
| 50 | -** | |
| 50 | +** | |
| 51 | 51 | */ |
| 52 | 52 | #include <stdio.h> |
| 53 | 53 | #include <ctype.h> |
| 54 | 54 | #include <stdlib.h> |
| 55 | 55 | #include <string.h> |
| @@ -122,11 +122,11 @@ | ||
| 122 | 122 | indent = i - 2; |
| 123 | 123 | if( indent<0 ) indent = 0; |
| 124 | 124 | omitline = 0; |
| 125 | 125 | for(j=0; zLine[i] && zLine[i]!='\r' && zLine[i]!='\n'; i++){ |
| 126 | 126 | if( zLine[i]==c1 && (c2==' ' || zLine[i+1]==c2) ){ |
| 127 | - omitline = 1; break; | |
| 127 | + omitline = 1; break; | |
| 128 | 128 | } |
| 129 | 129 | if( zLine[i]=='"' || zLine[i]=='\\' ){ zOut[j++] = '\\'; } |
| 130 | 130 | zOut[j++] = zLine[i]; |
| 131 | 131 | } |
| 132 | 132 | while( j>0 && isspace(zOut[j-1]) ){ j--; } |
| @@ -137,11 +137,11 @@ | ||
| 137 | 137 | fprintf(out,"%*s\"%s\\n\"\n",indent, "", zOut); |
| 138 | 138 | } |
| 139 | 139 | }else{ |
| 140 | 140 | /* Otherwise (if the last non-whitespace was not '=') then generate |
| 141 | 141 | ** a cgi_printf() statement whose format is the text following the '@'. |
| 142 | - ** Substrings of the form "%C(...)" (where C is any sequence of | |
| 142 | + ** Substrings of the form "%C(...)" (where C is any sequence of | |
| 143 | 143 | ** characters other than \000 and '(') will put "%C" in the |
| 144 | 144 | ** format and add the "(...)" as an argument to the cgi_printf call. |
| 145 | 145 | */ |
| 146 | 146 | int indent; |
| 147 | 147 | int nC; |
| @@ -174,11 +174,11 @@ | ||
| 174 | 174 | fprintf(out,"%*scgi_printf(\"%s\\n\"",indent-2,"", zOut); |
| 175 | 175 | inPrint = 1; |
| 176 | 176 | }else{ |
| 177 | 177 | fprintf(out,"\n%*s\"%s\\n\"",indent+5, "", zOut); |
| 178 | 178 | } |
| 179 | - } | |
| 179 | + } | |
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | int main(int argc, char **argv){ |
| 184 | 184 | if( argc==2 ){ |
| 185 | 185 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -13,11 +13,11 @@ | |
| 13 | ** [email protected] |
| 14 | ** http://www.hwaci.com/drh/ |
| 15 | ** |
| 16 | ******************************************************************************* |
| 17 | ** |
| 18 | ** SYNOPSIS: |
| 19 | ** |
| 20 | ** Input lines that begin with the "@" character are translated into |
| 21 | ** either cgi_printf() statements or string literals and the |
| 22 | ** translated code is written on standard output. |
| 23 | ** |
| @@ -34,22 +34,22 @@ | |
| 34 | ** punctuation. |
| 35 | ** |
| 36 | ** Enhancement #1: |
| 37 | ** |
| 38 | ** If the last non-whitespace character prior to the first "@" of a |
| 39 | ** @-block is "=" or "," then the @-block is a string literal initializer |
| 40 | ** rather than text that is to be output via cgi_printf(). Render it |
| 41 | ** as such. |
| 42 | ** |
| 43 | ** Enhancement #2: |
| 44 | ** |
| 45 | ** Comments of the form: "/* @-comment: CC" cause CC to become a |
| 46 | ** comment character for the @-substitution. Typical values for CC are |
| 47 | ** "--" (for SQL text) or "#" (for TCL script) or "//" (for C++ code). |
| 48 | ** Lines of subsequent @-blocks that begin with CC are omitted from the |
| 49 | ** output. |
| 50 | ** |
| 51 | */ |
| 52 | #include <stdio.h> |
| 53 | #include <ctype.h> |
| 54 | #include <stdlib.h> |
| 55 | #include <string.h> |
| @@ -122,11 +122,11 @@ | |
| 122 | indent = i - 2; |
| 123 | if( indent<0 ) indent = 0; |
| 124 | omitline = 0; |
| 125 | for(j=0; zLine[i] && zLine[i]!='\r' && zLine[i]!='\n'; i++){ |
| 126 | if( zLine[i]==c1 && (c2==' ' || zLine[i+1]==c2) ){ |
| 127 | omitline = 1; break; |
| 128 | } |
| 129 | if( zLine[i]=='"' || zLine[i]=='\\' ){ zOut[j++] = '\\'; } |
| 130 | zOut[j++] = zLine[i]; |
| 131 | } |
| 132 | while( j>0 && isspace(zOut[j-1]) ){ j--; } |
| @@ -137,11 +137,11 @@ | |
| 137 | fprintf(out,"%*s\"%s\\n\"\n",indent, "", zOut); |
| 138 | } |
| 139 | }else{ |
| 140 | /* Otherwise (if the last non-whitespace was not '=') then generate |
| 141 | ** a cgi_printf() statement whose format is the text following the '@'. |
| 142 | ** Substrings of the form "%C(...)" (where C is any sequence of |
| 143 | ** characters other than \000 and '(') will put "%C" in the |
| 144 | ** format and add the "(...)" as an argument to the cgi_printf call. |
| 145 | */ |
| 146 | int indent; |
| 147 | int nC; |
| @@ -174,11 +174,11 @@ | |
| 174 | fprintf(out,"%*scgi_printf(\"%s\\n\"",indent-2,"", zOut); |
| 175 | inPrint = 1; |
| 176 | }else{ |
| 177 | fprintf(out,"\n%*s\"%s\\n\"",indent+5, "", zOut); |
| 178 | } |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | int main(int argc, char **argv){ |
| 184 | if( argc==2 ){ |
| 185 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -13,11 +13,11 @@ | |
| 13 | ** [email protected] |
| 14 | ** http://www.hwaci.com/drh/ |
| 15 | ** |
| 16 | ******************************************************************************* |
| 17 | ** |
| 18 | ** SYNOPSIS: |
| 19 | ** |
| 20 | ** Input lines that begin with the "@" character are translated into |
| 21 | ** either cgi_printf() statements or string literals and the |
| 22 | ** translated code is written on standard output. |
| 23 | ** |
| @@ -34,22 +34,22 @@ | |
| 34 | ** punctuation. |
| 35 | ** |
| 36 | ** Enhancement #1: |
| 37 | ** |
| 38 | ** If the last non-whitespace character prior to the first "@" of a |
| 39 | ** @-block is "=" or "," then the @-block is a string literal initializer |
| 40 | ** rather than text that is to be output via cgi_printf(). Render it |
| 41 | ** as such. |
| 42 | ** |
| 43 | ** Enhancement #2: |
| 44 | ** |
| 45 | ** Comments of the form: "/* @-comment: CC" cause CC to become a |
| 46 | ** comment character for the @-substitution. Typical values for CC are |
| 47 | ** "--" (for SQL text) or "#" (for TCL script) or "//" (for C++ code). |
| 48 | ** Lines of subsequent @-blocks that begin with CC are omitted from the |
| 49 | ** output. |
| 50 | ** |
| 51 | */ |
| 52 | #include <stdio.h> |
| 53 | #include <ctype.h> |
| 54 | #include <stdlib.h> |
| 55 | #include <string.h> |
| @@ -122,11 +122,11 @@ | |
| 122 | indent = i - 2; |
| 123 | if( indent<0 ) indent = 0; |
| 124 | omitline = 0; |
| 125 | for(j=0; zLine[i] && zLine[i]!='\r' && zLine[i]!='\n'; i++){ |
| 126 | if( zLine[i]==c1 && (c2==' ' || zLine[i+1]==c2) ){ |
| 127 | omitline = 1; break; |
| 128 | } |
| 129 | if( zLine[i]=='"' || zLine[i]=='\\' ){ zOut[j++] = '\\'; } |
| 130 | zOut[j++] = zLine[i]; |
| 131 | } |
| 132 | while( j>0 && isspace(zOut[j-1]) ){ j--; } |
| @@ -137,11 +137,11 @@ | |
| 137 | fprintf(out,"%*s\"%s\\n\"\n",indent, "", zOut); |
| 138 | } |
| 139 | }else{ |
| 140 | /* Otherwise (if the last non-whitespace was not '=') then generate |
| 141 | ** a cgi_printf() statement whose format is the text following the '@'. |
| 142 | ** Substrings of the form "%C(...)" (where C is any sequence of |
| 143 | ** characters other than \000 and '(') will put "%C" in the |
| 144 | ** format and add the "(...)" as an argument to the cgi_printf call. |
| 145 | */ |
| 146 | int indent; |
| 147 | int nC; |
| @@ -174,11 +174,11 @@ | |
| 174 | fprintf(out,"%*scgi_printf(\"%s\\n\"",indent-2,"", zOut); |
| 175 | inPrint = 1; |
| 176 | }else{ |
| 177 | fprintf(out,"\n%*s\"%s\\n\"",indent+5, "", zOut); |
| 178 | } |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | int main(int argc, char **argv){ |
| 184 | if( argc==2 ){ |
| 185 |