Fossil SCM
Remove unnecessary end-of-line spaces. (My editor does that automatically, but I don't want it to happen together with other functional changes in a single commit). No change in code.
Commit
52b35c8b401f303177469153798ffa2d112a42e2
Parent
7c4414ca10e9f24…
12 files changed
+1
-1
+1
-1
+20
-20
+15
-15
+25
-25
+1
-1
+12
-12
+2
-2
+5
-5
+13
-13
+7
-7
+5
-5
+1
-1
| --- src/bag.c | ||
| +++ src/bag.c | ||
| @@ -75,11 +75,11 @@ | ||
| 75 | 75 | /* |
| 76 | 76 | ** Change the size of the hash table on a bag so that |
| 77 | 77 | ** it contains N slots |
| 78 | 78 | ** |
| 79 | 79 | ** Completely reconstruct the hash table from scratch. Deleted |
| 80 | -** entries (indicated by a -1) are removed. When finished, it | |
| 80 | +** entries (indicated by a -1) are removed. When finished, it | |
| 81 | 81 | ** should be the case that p->cnt==p->used. |
| 82 | 82 | */ |
| 83 | 83 | static void bag_resize(Bag *p, int newSize){ |
| 84 | 84 | int i; |
| 85 | 85 | Bag old; |
| 86 | 86 |
| --- src/bag.c | |
| +++ src/bag.c | |
| @@ -75,11 +75,11 @@ | |
| 75 | /* |
| 76 | ** Change the size of the hash table on a bag so that |
| 77 | ** it contains N slots |
| 78 | ** |
| 79 | ** Completely reconstruct the hash table from scratch. Deleted |
| 80 | ** entries (indicated by a -1) are removed. When finished, it |
| 81 | ** should be the case that p->cnt==p->used. |
| 82 | */ |
| 83 | static void bag_resize(Bag *p, int newSize){ |
| 84 | int i; |
| 85 | Bag old; |
| 86 |
| --- src/bag.c | |
| +++ src/bag.c | |
| @@ -75,11 +75,11 @@ | |
| 75 | /* |
| 76 | ** Change the size of the hash table on a bag so that |
| 77 | ** it contains N slots |
| 78 | ** |
| 79 | ** Completely reconstruct the hash table from scratch. Deleted |
| 80 | ** entries (indicated by a -1) are removed. When finished, it |
| 81 | ** should be the case that p->cnt==p->used. |
| 82 | */ |
| 83 | static void bag_resize(Bag *p, int newSize){ |
| 84 | int i; |
| 85 | Bag old; |
| 86 |
+1
-1
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -370,11 +370,11 @@ | ||
| 370 | 370 | g.argv[2] = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pMid->rid); |
| 371 | 371 | g.argc = 3; |
| 372 | 372 | g.fNoSync = 1; |
| 373 | 373 | update_cmd(); |
| 374 | 374 | } |
| 375 | - | |
| 375 | + | |
| 376 | 376 | if( strncmp(zDisplay,"chart",m)==0 ){ |
| 377 | 377 | bisect_chart(1); |
| 378 | 378 | }else if( strncmp(zDisplay, "log", m)==0 ){ |
| 379 | 379 | bisect_chart(0); |
| 380 | 380 | }else if( strncmp(zDisplay, "status", m)==0 ){ |
| 381 | 381 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -370,11 +370,11 @@ | |
| 370 | g.argv[2] = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pMid->rid); |
| 371 | g.argc = 3; |
| 372 | g.fNoSync = 1; |
| 373 | update_cmd(); |
| 374 | } |
| 375 | |
| 376 | if( strncmp(zDisplay,"chart",m)==0 ){ |
| 377 | bisect_chart(1); |
| 378 | }else if( strncmp(zDisplay, "log", m)==0 ){ |
| 379 | bisect_chart(0); |
| 380 | }else if( strncmp(zDisplay, "status", m)==0 ){ |
| 381 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -370,11 +370,11 @@ | |
| 370 | g.argv[2] = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", pMid->rid); |
| 371 | g.argc = 3; |
| 372 | g.fNoSync = 1; |
| 373 | update_cmd(); |
| 374 | } |
| 375 | |
| 376 | if( strncmp(zDisplay,"chart",m)==0 ){ |
| 377 | bisect_chart(1); |
| 378 | }else if( strncmp(zDisplay, "log", m)==0 ){ |
| 379 | bisect_chart(0); |
| 380 | }else if( strncmp(zDisplay, "status", m)==0 ){ |
| 381 |
+20
-20
| --- src/captcha.c | ||
| +++ src/captcha.c | ||
| @@ -92,11 +92,11 @@ | ||
| 92 | 92 | z[k++] = ' '; |
| 93 | 93 | } |
| 94 | 94 | z[k++] = '\n'; |
| 95 | 95 | } |
| 96 | 96 | z[k] = 0; |
| 97 | - return z; | |
| 97 | + return z; | |
| 98 | 98 | } |
| 99 | 99 | #endif /* CAPTCHA==1 */ |
| 100 | 100 | |
| 101 | 101 | |
| 102 | 102 | #if CAPTCHA==2 |
| @@ -148,11 +148,11 @@ | ||
| 148 | 148 | "|__ |", |
| 149 | 149 | " / / ", |
| 150 | 150 | " /_/ ", |
| 151 | 151 | |
| 152 | 152 | /* 8 */ |
| 153 | - " ___ ", | |
| 153 | + " ___ ", | |
| 154 | 154 | "( _ )", |
| 155 | 155 | "/ _ \\", |
| 156 | 156 | "\\___/", |
| 157 | 157 | |
| 158 | 158 | /* 9 */ |
| @@ -218,11 +218,11 @@ | ||
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | z[k++] = '\n'; |
| 221 | 221 | } |
| 222 | 222 | z[k] = 0; |
| 223 | - return z; | |
| 223 | + return z; | |
| 224 | 224 | } |
| 225 | 225 | #endif /* CAPTCHA==2 */ |
| 226 | 226 | |
| 227 | 227 | #if CAPTCHA==3 |
| 228 | 228 | static const char *const azFont3[] = { |
| @@ -231,123 +231,123 @@ | ||
| 231 | 231 | " / _ \\ ", |
| 232 | 232 | "| | | |", |
| 233 | 233 | "| | | |", |
| 234 | 234 | "| |_| |", |
| 235 | 235 | " \\___/ ", |
| 236 | - | |
| 236 | + | |
| 237 | 237 | /* 1 */ |
| 238 | 238 | " __ ", |
| 239 | 239 | "/_ |", |
| 240 | 240 | " | |", |
| 241 | 241 | " | |", |
| 242 | 242 | " | |", |
| 243 | 243 | " |_|", |
| 244 | - | |
| 244 | + | |
| 245 | 245 | /* 2 */ |
| 246 | 246 | " ___ ", |
| 247 | 247 | "|__ \\ ", |
| 248 | 248 | " ) |", |
| 249 | 249 | " / / ", |
| 250 | 250 | " / /_ ", |
| 251 | 251 | "|____|", |
| 252 | - | |
| 252 | + | |
| 253 | 253 | /* 3 */ |
| 254 | 254 | " ____ ", |
| 255 | 255 | "|___ \\ ", |
| 256 | 256 | " __) |", |
| 257 | 257 | " |__ < ", |
| 258 | 258 | " ___) |", |
| 259 | 259 | "|____/ ", |
| 260 | - | |
| 260 | + | |
| 261 | 261 | /* 4 */ |
| 262 | 262 | " _ _ ", |
| 263 | 263 | "| || | ", |
| 264 | 264 | "| || |_ ", |
| 265 | 265 | "|__ _|", |
| 266 | 266 | " | | ", |
| 267 | 267 | " |_| ", |
| 268 | - | |
| 268 | + | |
| 269 | 269 | /* 5 */ |
| 270 | 270 | " _____ ", |
| 271 | 271 | "| ____|", |
| 272 | 272 | "| |__ ", |
| 273 | 273 | "|___ \\ ", |
| 274 | 274 | " ___) |", |
| 275 | 275 | "|____/ ", |
| 276 | - | |
| 276 | + | |
| 277 | 277 | /* 6 */ |
| 278 | 278 | " __ ", |
| 279 | 279 | " / / ", |
| 280 | 280 | " / /_ ", |
| 281 | 281 | "| '_ \\ ", |
| 282 | 282 | "| (_) |", |
| 283 | 283 | " \\___/ ", |
| 284 | - | |
| 284 | + | |
| 285 | 285 | /* 7 */ |
| 286 | 286 | " ______ ", |
| 287 | 287 | "|____ |", |
| 288 | 288 | " / / ", |
| 289 | 289 | " / / ", |
| 290 | 290 | " / / ", |
| 291 | 291 | " /_/ ", |
| 292 | - | |
| 292 | + | |
| 293 | 293 | /* 8 */ |
| 294 | 294 | " ___ ", |
| 295 | 295 | " / _ \\ ", |
| 296 | 296 | "| (_) |", |
| 297 | 297 | " > _ < ", |
| 298 | 298 | "| (_) |", |
| 299 | 299 | " \\___/ ", |
| 300 | - | |
| 300 | + | |
| 301 | 301 | /* 9 */ |
| 302 | 302 | " ___ ", |
| 303 | 303 | " / _ \\ ", |
| 304 | 304 | "| (_) |", |
| 305 | 305 | " \\__, |", |
| 306 | 306 | " / / ", |
| 307 | 307 | " /_/ ", |
| 308 | - | |
| 308 | + | |
| 309 | 309 | /* A */ |
| 310 | 310 | " ", |
| 311 | 311 | " /\\ ", |
| 312 | 312 | " / \\ ", |
| 313 | 313 | " / /\\ \\ ", |
| 314 | 314 | " / ____ \\ ", |
| 315 | 315 | "/_/ \\_\\", |
| 316 | - | |
| 316 | + | |
| 317 | 317 | /* B */ |
| 318 | 318 | " ____ ", |
| 319 | 319 | "| _ \\ ", |
| 320 | 320 | "| |_) |", |
| 321 | 321 | "| _ < ", |
| 322 | 322 | "| |_) |", |
| 323 | 323 | "|____/ ", |
| 324 | - | |
| 324 | + | |
| 325 | 325 | /* C */ |
| 326 | 326 | " _____ ", |
| 327 | 327 | " / ____|", |
| 328 | 328 | "| | ", |
| 329 | 329 | "| | ", |
| 330 | 330 | "| |____ ", |
| 331 | 331 | " \\_____|", |
| 332 | - | |
| 332 | + | |
| 333 | 333 | /* D */ |
| 334 | 334 | " _____ ", |
| 335 | 335 | "| __ \\ ", |
| 336 | 336 | "| | | |", |
| 337 | 337 | "| | | |", |
| 338 | 338 | "| |__| |", |
| 339 | 339 | "|_____/ ", |
| 340 | - | |
| 340 | + | |
| 341 | 341 | /* E */ |
| 342 | 342 | " ______ ", |
| 343 | 343 | "| ____|", |
| 344 | 344 | "| |__ ", |
| 345 | 345 | "| __| ", |
| 346 | 346 | "| |____ ", |
| 347 | 347 | "|______|", |
| 348 | - | |
| 348 | + | |
| 349 | 349 | /* F */ |
| 350 | 350 | " ______ ", |
| 351 | 351 | "| ____|", |
| 352 | 352 | "| |__ ", |
| 353 | 353 | "| __| ", |
| @@ -408,11 +408,11 @@ | ||
| 408 | 408 | } |
| 409 | 409 | } |
| 410 | 410 | z[k++] = '\n'; |
| 411 | 411 | } |
| 412 | 412 | z[k] = 0; |
| 413 | - return z; | |
| 413 | + return z; | |
| 414 | 414 | } |
| 415 | 415 | #endif /* CAPTCHA==3 */ |
| 416 | 416 | |
| 417 | 417 | /* |
| 418 | 418 | ** COMMAND: test-captcha |
| @@ -478,11 +478,11 @@ | ||
| 478 | 478 | ** Return true if a CAPTCHA is required for editing wiki or tickets or for |
| 479 | 479 | ** adding attachments. |
| 480 | 480 | ** |
| 481 | 481 | ** A CAPTCHA is required in those cases if the user is not logged in (if they |
| 482 | 482 | ** are user "nobody") and if the "require-captcha" setting is true. The |
| 483 | -** "require-captcha" setting is controlled on the Admin/Access page. It | |
| 483 | +** "require-captcha" setting is controlled on the Admin/Access page. It | |
| 484 | 484 | ** defaults to true. |
| 485 | 485 | */ |
| 486 | 486 | int captcha_needed(void){ |
| 487 | 487 | if( g.zLogin!=0 ) return 0; |
| 488 | 488 | return db_get_boolean("require-captcha", 1); |
| 489 | 489 |
| --- src/captcha.c | |
| +++ src/captcha.c | |
| @@ -92,11 +92,11 @@ | |
| 92 | z[k++] = ' '; |
| 93 | } |
| 94 | z[k++] = '\n'; |
| 95 | } |
| 96 | z[k] = 0; |
| 97 | return z; |
| 98 | } |
| 99 | #endif /* CAPTCHA==1 */ |
| 100 | |
| 101 | |
| 102 | #if CAPTCHA==2 |
| @@ -148,11 +148,11 @@ | |
| 148 | "|__ |", |
| 149 | " / / ", |
| 150 | " /_/ ", |
| 151 | |
| 152 | /* 8 */ |
| 153 | " ___ ", |
| 154 | "( _ )", |
| 155 | "/ _ \\", |
| 156 | "\\___/", |
| 157 | |
| 158 | /* 9 */ |
| @@ -218,11 +218,11 @@ | |
| 218 | } |
| 219 | } |
| 220 | z[k++] = '\n'; |
| 221 | } |
| 222 | z[k] = 0; |
| 223 | return z; |
| 224 | } |
| 225 | #endif /* CAPTCHA==2 */ |
| 226 | |
| 227 | #if CAPTCHA==3 |
| 228 | static const char *const azFont3[] = { |
| @@ -231,123 +231,123 @@ | |
| 231 | " / _ \\ ", |
| 232 | "| | | |", |
| 233 | "| | | |", |
| 234 | "| |_| |", |
| 235 | " \\___/ ", |
| 236 | |
| 237 | /* 1 */ |
| 238 | " __ ", |
| 239 | "/_ |", |
| 240 | " | |", |
| 241 | " | |", |
| 242 | " | |", |
| 243 | " |_|", |
| 244 | |
| 245 | /* 2 */ |
| 246 | " ___ ", |
| 247 | "|__ \\ ", |
| 248 | " ) |", |
| 249 | " / / ", |
| 250 | " / /_ ", |
| 251 | "|____|", |
| 252 | |
| 253 | /* 3 */ |
| 254 | " ____ ", |
| 255 | "|___ \\ ", |
| 256 | " __) |", |
| 257 | " |__ < ", |
| 258 | " ___) |", |
| 259 | "|____/ ", |
| 260 | |
| 261 | /* 4 */ |
| 262 | " _ _ ", |
| 263 | "| || | ", |
| 264 | "| || |_ ", |
| 265 | "|__ _|", |
| 266 | " | | ", |
| 267 | " |_| ", |
| 268 | |
| 269 | /* 5 */ |
| 270 | " _____ ", |
| 271 | "| ____|", |
| 272 | "| |__ ", |
| 273 | "|___ \\ ", |
| 274 | " ___) |", |
| 275 | "|____/ ", |
| 276 | |
| 277 | /* 6 */ |
| 278 | " __ ", |
| 279 | " / / ", |
| 280 | " / /_ ", |
| 281 | "| '_ \\ ", |
| 282 | "| (_) |", |
| 283 | " \\___/ ", |
| 284 | |
| 285 | /* 7 */ |
| 286 | " ______ ", |
| 287 | "|____ |", |
| 288 | " / / ", |
| 289 | " / / ", |
| 290 | " / / ", |
| 291 | " /_/ ", |
| 292 | |
| 293 | /* 8 */ |
| 294 | " ___ ", |
| 295 | " / _ \\ ", |
| 296 | "| (_) |", |
| 297 | " > _ < ", |
| 298 | "| (_) |", |
| 299 | " \\___/ ", |
| 300 | |
| 301 | /* 9 */ |
| 302 | " ___ ", |
| 303 | " / _ \\ ", |
| 304 | "| (_) |", |
| 305 | " \\__, |", |
| 306 | " / / ", |
| 307 | " /_/ ", |
| 308 | |
| 309 | /* A */ |
| 310 | " ", |
| 311 | " /\\ ", |
| 312 | " / \\ ", |
| 313 | " / /\\ \\ ", |
| 314 | " / ____ \\ ", |
| 315 | "/_/ \\_\\", |
| 316 | |
| 317 | /* B */ |
| 318 | " ____ ", |
| 319 | "| _ \\ ", |
| 320 | "| |_) |", |
| 321 | "| _ < ", |
| 322 | "| |_) |", |
| 323 | "|____/ ", |
| 324 | |
| 325 | /* C */ |
| 326 | " _____ ", |
| 327 | " / ____|", |
| 328 | "| | ", |
| 329 | "| | ", |
| 330 | "| |____ ", |
| 331 | " \\_____|", |
| 332 | |
| 333 | /* D */ |
| 334 | " _____ ", |
| 335 | "| __ \\ ", |
| 336 | "| | | |", |
| 337 | "| | | |", |
| 338 | "| |__| |", |
| 339 | "|_____/ ", |
| 340 | |
| 341 | /* E */ |
| 342 | " ______ ", |
| 343 | "| ____|", |
| 344 | "| |__ ", |
| 345 | "| __| ", |
| 346 | "| |____ ", |
| 347 | "|______|", |
| 348 | |
| 349 | /* F */ |
| 350 | " ______ ", |
| 351 | "| ____|", |
| 352 | "| |__ ", |
| 353 | "| __| ", |
| @@ -408,11 +408,11 @@ | |
| 408 | } |
| 409 | } |
| 410 | z[k++] = '\n'; |
| 411 | } |
| 412 | z[k] = 0; |
| 413 | return z; |
| 414 | } |
| 415 | #endif /* CAPTCHA==3 */ |
| 416 | |
| 417 | /* |
| 418 | ** COMMAND: test-captcha |
| @@ -478,11 +478,11 @@ | |
| 478 | ** Return true if a CAPTCHA is required for editing wiki or tickets or for |
| 479 | ** adding attachments. |
| 480 | ** |
| 481 | ** A CAPTCHA is required in those cases if the user is not logged in (if they |
| 482 | ** are user "nobody") and if the "require-captcha" setting is true. The |
| 483 | ** "require-captcha" setting is controlled on the Admin/Access page. It |
| 484 | ** defaults to true. |
| 485 | */ |
| 486 | int captcha_needed(void){ |
| 487 | if( g.zLogin!=0 ) return 0; |
| 488 | return db_get_boolean("require-captcha", 1); |
| 489 |
| --- src/captcha.c | |
| +++ src/captcha.c | |
| @@ -92,11 +92,11 @@ | |
| 92 | z[k++] = ' '; |
| 93 | } |
| 94 | z[k++] = '\n'; |
| 95 | } |
| 96 | z[k] = 0; |
| 97 | return z; |
| 98 | } |
| 99 | #endif /* CAPTCHA==1 */ |
| 100 | |
| 101 | |
| 102 | #if CAPTCHA==2 |
| @@ -148,11 +148,11 @@ | |
| 148 | "|__ |", |
| 149 | " / / ", |
| 150 | " /_/ ", |
| 151 | |
| 152 | /* 8 */ |
| 153 | " ___ ", |
| 154 | "( _ )", |
| 155 | "/ _ \\", |
| 156 | "\\___/", |
| 157 | |
| 158 | /* 9 */ |
| @@ -218,11 +218,11 @@ | |
| 218 | } |
| 219 | } |
| 220 | z[k++] = '\n'; |
| 221 | } |
| 222 | z[k] = 0; |
| 223 | return z; |
| 224 | } |
| 225 | #endif /* CAPTCHA==2 */ |
| 226 | |
| 227 | #if CAPTCHA==3 |
| 228 | static const char *const azFont3[] = { |
| @@ -231,123 +231,123 @@ | |
| 231 | " / _ \\ ", |
| 232 | "| | | |", |
| 233 | "| | | |", |
| 234 | "| |_| |", |
| 235 | " \\___/ ", |
| 236 | |
| 237 | /* 1 */ |
| 238 | " __ ", |
| 239 | "/_ |", |
| 240 | " | |", |
| 241 | " | |", |
| 242 | " | |", |
| 243 | " |_|", |
| 244 | |
| 245 | /* 2 */ |
| 246 | " ___ ", |
| 247 | "|__ \\ ", |
| 248 | " ) |", |
| 249 | " / / ", |
| 250 | " / /_ ", |
| 251 | "|____|", |
| 252 | |
| 253 | /* 3 */ |
| 254 | " ____ ", |
| 255 | "|___ \\ ", |
| 256 | " __) |", |
| 257 | " |__ < ", |
| 258 | " ___) |", |
| 259 | "|____/ ", |
| 260 | |
| 261 | /* 4 */ |
| 262 | " _ _ ", |
| 263 | "| || | ", |
| 264 | "| || |_ ", |
| 265 | "|__ _|", |
| 266 | " | | ", |
| 267 | " |_| ", |
| 268 | |
| 269 | /* 5 */ |
| 270 | " _____ ", |
| 271 | "| ____|", |
| 272 | "| |__ ", |
| 273 | "|___ \\ ", |
| 274 | " ___) |", |
| 275 | "|____/ ", |
| 276 | |
| 277 | /* 6 */ |
| 278 | " __ ", |
| 279 | " / / ", |
| 280 | " / /_ ", |
| 281 | "| '_ \\ ", |
| 282 | "| (_) |", |
| 283 | " \\___/ ", |
| 284 | |
| 285 | /* 7 */ |
| 286 | " ______ ", |
| 287 | "|____ |", |
| 288 | " / / ", |
| 289 | " / / ", |
| 290 | " / / ", |
| 291 | " /_/ ", |
| 292 | |
| 293 | /* 8 */ |
| 294 | " ___ ", |
| 295 | " / _ \\ ", |
| 296 | "| (_) |", |
| 297 | " > _ < ", |
| 298 | "| (_) |", |
| 299 | " \\___/ ", |
| 300 | |
| 301 | /* 9 */ |
| 302 | " ___ ", |
| 303 | " / _ \\ ", |
| 304 | "| (_) |", |
| 305 | " \\__, |", |
| 306 | " / / ", |
| 307 | " /_/ ", |
| 308 | |
| 309 | /* A */ |
| 310 | " ", |
| 311 | " /\\ ", |
| 312 | " / \\ ", |
| 313 | " / /\\ \\ ", |
| 314 | " / ____ \\ ", |
| 315 | "/_/ \\_\\", |
| 316 | |
| 317 | /* B */ |
| 318 | " ____ ", |
| 319 | "| _ \\ ", |
| 320 | "| |_) |", |
| 321 | "| _ < ", |
| 322 | "| |_) |", |
| 323 | "|____/ ", |
| 324 | |
| 325 | /* C */ |
| 326 | " _____ ", |
| 327 | " / ____|", |
| 328 | "| | ", |
| 329 | "| | ", |
| 330 | "| |____ ", |
| 331 | " \\_____|", |
| 332 | |
| 333 | /* D */ |
| 334 | " _____ ", |
| 335 | "| __ \\ ", |
| 336 | "| | | |", |
| 337 | "| | | |", |
| 338 | "| |__| |", |
| 339 | "|_____/ ", |
| 340 | |
| 341 | /* E */ |
| 342 | " ______ ", |
| 343 | "| ____|", |
| 344 | "| |__ ", |
| 345 | "| __| ", |
| 346 | "| |____ ", |
| 347 | "|______|", |
| 348 | |
| 349 | /* F */ |
| 350 | " ______ ", |
| 351 | "| ____|", |
| 352 | "| |__ ", |
| 353 | "| __| ", |
| @@ -408,11 +408,11 @@ | |
| 408 | } |
| 409 | } |
| 410 | z[k++] = '\n'; |
| 411 | } |
| 412 | z[k] = 0; |
| 413 | return z; |
| 414 | } |
| 415 | #endif /* CAPTCHA==3 */ |
| 416 | |
| 417 | /* |
| 418 | ** COMMAND: test-captcha |
| @@ -478,11 +478,11 @@ | |
| 478 | ** Return true if a CAPTCHA is required for editing wiki or tickets or for |
| 479 | ** adding attachments. |
| 480 | ** |
| 481 | ** A CAPTCHA is required in those cases if the user is not logged in (if they |
| 482 | ** are user "nobody") and if the "require-captcha" setting is true. The |
| 483 | ** "require-captcha" setting is controlled on the Admin/Access page. It |
| 484 | ** defaults to true. |
| 485 | */ |
| 486 | int captcha_needed(void){ |
| 487 | if( g.zLogin!=0 ) return 0; |
| 488 | return db_get_boolean("require-captcha", 1); |
| 489 |
+15
-15
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -114,11 +114,11 @@ | ||
| 114 | 114 | contentCache.n = 0; |
| 115 | 115 | contentCache.szTotal = 0; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /* |
| 119 | -** Return the srcid associated with rid. Or return 0 if rid is | |
| 119 | +** Return the srcid associated with rid. Or return 0 if rid is | |
| 120 | 120 | ** original content and not a delta. |
| 121 | 121 | */ |
| 122 | 122 | static int findSrcid(int rid){ |
| 123 | 123 | static Stmt q; |
| 124 | 124 | int srcid; |
| @@ -154,11 +154,11 @@ | ||
| 154 | 154 | ** a phantom. |
| 155 | 155 | */ |
| 156 | 156 | int content_is_available(int rid){ |
| 157 | 157 | int srcid; |
| 158 | 158 | int depth = 0; /* Limit to recursion depth */ |
| 159 | - while( depth++ < 10000000 ){ | |
| 159 | + while( depth++ < 10000000 ){ | |
| 160 | 160 | if( bag_find(&contentCache.missing, rid) ){ |
| 161 | 161 | return 0; |
| 162 | 162 | } |
| 163 | 163 | if( bag_find(&contentCache.available, rid) ){ |
| 164 | 164 | return 1; |
| @@ -416,11 +416,11 @@ | ||
| 416 | 416 | |
| 417 | 417 | /* Recursively dephantomize all artifacts that are derived by |
| 418 | 418 | ** delta from artifact rid and which have not already been |
| 419 | 419 | ** cross-linked. */ |
| 420 | 420 | nChildUsed = 0; |
| 421 | - db_prepare(&q, | |
| 421 | + db_prepare(&q, | |
| 422 | 422 | "SELECT rid FROM delta" |
| 423 | 423 | " WHERE srcid=%d" |
| 424 | 424 | " AND NOT EXISTS(SELECT 1 FROM mlink WHERE mid=delta.rid)", |
| 425 | 425 | rid |
| 426 | 426 | ); |
| @@ -455,11 +455,11 @@ | ||
| 455 | 455 | /* |
| 456 | 456 | ** Write content into the database. Return the record ID. If the |
| 457 | 457 | ** content is already in the database, just return the record ID. |
| 458 | 458 | ** |
| 459 | 459 | ** If srcId is specified, then pBlob is delta content from |
| 460 | -** the srcId record. srcId might be a phantom. | |
| 460 | +** the srcId record. srcId might be a phantom. | |
| 461 | 461 | ** |
| 462 | 462 | ** pBlob is normally uncompressed text. But if nBlob>0 then the |
| 463 | 463 | ** pBlob value has already been compressed and nBlob is its uncompressed |
| 464 | 464 | ** size. If nBlob>0 then zUuid must be valid. |
| 465 | 465 | ** |
| @@ -486,11 +486,11 @@ | ||
| 486 | 486 | Stmt s1; |
| 487 | 487 | Blob cmpr; |
| 488 | 488 | Blob hash; |
| 489 | 489 | int markAsUnclustered = 0; |
| 490 | 490 | int isDephantomize = 0; |
| 491 | - | |
| 491 | + | |
| 492 | 492 | assert( g.repositoryOpen ); |
| 493 | 493 | assert( pBlob!=0 ); |
| 494 | 494 | assert( srcId==0 || zUuid!=0 ); |
| 495 | 495 | if( zUuid==0 ){ |
| 496 | 496 | assert( nBlob==0 ); |
| @@ -580,18 +580,18 @@ | ||
| 580 | 580 | ** really a delta. Record this fact in the delta table. |
| 581 | 581 | */ |
| 582 | 582 | if( srcId ){ |
| 583 | 583 | db_multi_exec("REPLACE INTO delta(rid,srcid) VALUES(%d,%d)", rid, srcId); |
| 584 | 584 | } |
| 585 | - if( !isDephantomize && bag_find(&contentCache.missing, rid) && | |
| 585 | + if( !isDephantomize && bag_find(&contentCache.missing, rid) && | |
| 586 | 586 | (srcId==0 || content_is_available(srcId)) ){ |
| 587 | 587 | content_mark_available(rid); |
| 588 | 588 | } |
| 589 | 589 | if( isDephantomize ){ |
| 590 | 590 | after_dephantomize(rid, 0); |
| 591 | 591 | } |
| 592 | - | |
| 592 | + | |
| 593 | 593 | /* Add the element to the unclustered table if has never been |
| 594 | 594 | ** previously seen. |
| 595 | 595 | */ |
| 596 | 596 | if( markAsUnclustered ){ |
| 597 | 597 | db_multi_exec("INSERT OR IGNORE INTO unclustered VALUES(%d)", rid); |
| @@ -628,11 +628,11 @@ | ||
| 628 | 628 | ** Create a new phantom with the given UUID and return its artifact ID. |
| 629 | 629 | */ |
| 630 | 630 | int content_new(const char *zUuid, int isPrivate){ |
| 631 | 631 | int rid; |
| 632 | 632 | static Stmt s1, s2, s3; |
| 633 | - | |
| 633 | + | |
| 634 | 634 | assert( g.repositoryOpen ); |
| 635 | 635 | db_begin_transaction(); |
| 636 | 636 | if( uuid_is_shunned(zUuid) ){ |
| 637 | 637 | db_end_transaction(0); |
| 638 | 638 | return 0; |
| @@ -727,15 +727,15 @@ | ||
| 727 | 727 | "SELECT 1 FROM private WHERE rid=:rid" |
| 728 | 728 | ); |
| 729 | 729 | db_bind_int(&s1, ":rid", rid); |
| 730 | 730 | rc = db_step(&s1); |
| 731 | 731 | db_reset(&s1); |
| 732 | - return rc==SQLITE_ROW; | |
| 732 | + return rc==SQLITE_ROW; | |
| 733 | 733 | } |
| 734 | 734 | |
| 735 | 735 | /* |
| 736 | -** Make sure an artifact is public. | |
| 736 | +** Make sure an artifact is public. | |
| 737 | 737 | */ |
| 738 | 738 | void content_make_public(int rid){ |
| 739 | 739 | static Stmt s1; |
| 740 | 740 | db_static_prepare(&s1, |
| 741 | 741 | "DELETE FROM private WHERE rid=:rid" |
| @@ -758,11 +758,11 @@ | ||
| 758 | 758 | ** |
| 759 | 759 | ** If srcid is a delta that depends on rid, then srcid is |
| 760 | 760 | ** converted to undeltaed text. |
| 761 | 761 | ** |
| 762 | 762 | ** If either rid or srcid contain less than 50 bytes, or if the |
| 763 | -** resulting delta does not achieve a compression of at least 25% | |
| 763 | +** resulting delta does not achieve a compression of at least 25% | |
| 764 | 764 | ** the rid is left untouched. |
| 765 | 765 | ** |
| 766 | 766 | ** Return 1 if a delta is made and 0 if no delta occurs. |
| 767 | 767 | */ |
| 768 | 768 | int content_deltify(int rid, int srcid, int force){ |
| @@ -883,11 +883,11 @@ | ||
| 883 | 883 | zId, rid, zSrc, srcid |
| 884 | 884 | ); |
| 885 | 885 | nErr++; |
| 886 | 886 | } |
| 887 | 887 | db_finalize(&q); |
| 888 | - | |
| 888 | + | |
| 889 | 889 | db_prepare(&q, "SELECT rid, uuid, size FROM blob ORDER BY rid"); |
| 890 | 890 | total = db_int(0, "SELECT max(rid) FROM blob"); |
| 891 | 891 | while( db_step(&q)==SQLITE_ROW ){ |
| 892 | 892 | int rid = db_column_int(&q, 0); |
| 893 | 893 | const char *zUuid = db_column_text(&q, 1); |
| @@ -1050,11 +1050,11 @@ | ||
| 1050 | 1050 | if( zDetail && zDetail[0] ){ |
| 1051 | 1051 | fossil_print(" %s\n", zDetail); |
| 1052 | 1052 | } |
| 1053 | 1053 | fossil_free(zSrc); |
| 1054 | 1054 | fossil_free(zDate); |
| 1055 | - rc = 1; | |
| 1055 | + rc = 1; | |
| 1056 | 1056 | } |
| 1057 | 1057 | return rc; |
| 1058 | 1058 | } |
| 1059 | 1059 | |
| 1060 | 1060 | /* |
| @@ -1097,11 +1097,11 @@ | ||
| 1097 | 1097 | if( p ){ |
| 1098 | 1098 | nArtifact++; |
| 1099 | 1099 | nErr += check_exists(p->zBaseline, flags, p, "baseline of", 0); |
| 1100 | 1100 | nErr += check_exists(p->zAttachSrc, flags, p, "file of", 0); |
| 1101 | 1101 | for(i=0; i<p->nFile; i++){ |
| 1102 | - nErr += check_exists(p->aFile[i].zUuid, flags, p, "file of", | |
| 1102 | + nErr += check_exists(p->aFile[i].zUuid, flags, p, "file of", | |
| 1103 | 1103 | p->aFile[i].zName); |
| 1104 | 1104 | } |
| 1105 | 1105 | for(i=0; i<p->nParent; i++){ |
| 1106 | 1106 | nErr += check_exists(p->azParent[i], flags, p, "parent of", 0); |
| 1107 | 1107 | } |
| @@ -1115,14 +1115,14 @@ | ||
| 1115 | 1115 | nErr += check_exists(p->azCChild[i], flags, p, "in", 0); |
| 1116 | 1116 | } |
| 1117 | 1117 | for(i=0; i<p->nTag; i++){ |
| 1118 | 1118 | nErr += check_exists(p->aTag[i].zUuid, flags, p, "target of", 0); |
| 1119 | 1119 | } |
| 1120 | - manifest_destroy(p); | |
| 1120 | + manifest_destroy(p); | |
| 1121 | 1121 | } |
| 1122 | 1122 | } |
| 1123 | 1123 | db_finalize(&q); |
| 1124 | 1124 | if( nErr>0 || quietFlag==0 ){ |
| 1125 | 1125 | fossil_print("%d missing or shunned references in %d control artifacts\n", |
| 1126 | 1126 | nErr, nArtifact); |
| 1127 | 1127 | } |
| 1128 | 1128 | } |
| 1129 | 1129 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -114,11 +114,11 @@ | |
| 114 | contentCache.n = 0; |
| 115 | contentCache.szTotal = 0; |
| 116 | } |
| 117 | |
| 118 | /* |
| 119 | ** Return the srcid associated with rid. Or return 0 if rid is |
| 120 | ** original content and not a delta. |
| 121 | */ |
| 122 | static int findSrcid(int rid){ |
| 123 | static Stmt q; |
| 124 | int srcid; |
| @@ -154,11 +154,11 @@ | |
| 154 | ** a phantom. |
| 155 | */ |
| 156 | int content_is_available(int rid){ |
| 157 | int srcid; |
| 158 | int depth = 0; /* Limit to recursion depth */ |
| 159 | while( depth++ < 10000000 ){ |
| 160 | if( bag_find(&contentCache.missing, rid) ){ |
| 161 | return 0; |
| 162 | } |
| 163 | if( bag_find(&contentCache.available, rid) ){ |
| 164 | return 1; |
| @@ -416,11 +416,11 @@ | |
| 416 | |
| 417 | /* Recursively dephantomize all artifacts that are derived by |
| 418 | ** delta from artifact rid and which have not already been |
| 419 | ** cross-linked. */ |
| 420 | nChildUsed = 0; |
| 421 | db_prepare(&q, |
| 422 | "SELECT rid FROM delta" |
| 423 | " WHERE srcid=%d" |
| 424 | " AND NOT EXISTS(SELECT 1 FROM mlink WHERE mid=delta.rid)", |
| 425 | rid |
| 426 | ); |
| @@ -455,11 +455,11 @@ | |
| 455 | /* |
| 456 | ** Write content into the database. Return the record ID. If the |
| 457 | ** content is already in the database, just return the record ID. |
| 458 | ** |
| 459 | ** If srcId is specified, then pBlob is delta content from |
| 460 | ** the srcId record. srcId might be a phantom. |
| 461 | ** |
| 462 | ** pBlob is normally uncompressed text. But if nBlob>0 then the |
| 463 | ** pBlob value has already been compressed and nBlob is its uncompressed |
| 464 | ** size. If nBlob>0 then zUuid must be valid. |
| 465 | ** |
| @@ -486,11 +486,11 @@ | |
| 486 | Stmt s1; |
| 487 | Blob cmpr; |
| 488 | Blob hash; |
| 489 | int markAsUnclustered = 0; |
| 490 | int isDephantomize = 0; |
| 491 | |
| 492 | assert( g.repositoryOpen ); |
| 493 | assert( pBlob!=0 ); |
| 494 | assert( srcId==0 || zUuid!=0 ); |
| 495 | if( zUuid==0 ){ |
| 496 | assert( nBlob==0 ); |
| @@ -580,18 +580,18 @@ | |
| 580 | ** really a delta. Record this fact in the delta table. |
| 581 | */ |
| 582 | if( srcId ){ |
| 583 | db_multi_exec("REPLACE INTO delta(rid,srcid) VALUES(%d,%d)", rid, srcId); |
| 584 | } |
| 585 | if( !isDephantomize && bag_find(&contentCache.missing, rid) && |
| 586 | (srcId==0 || content_is_available(srcId)) ){ |
| 587 | content_mark_available(rid); |
| 588 | } |
| 589 | if( isDephantomize ){ |
| 590 | after_dephantomize(rid, 0); |
| 591 | } |
| 592 | |
| 593 | /* Add the element to the unclustered table if has never been |
| 594 | ** previously seen. |
| 595 | */ |
| 596 | if( markAsUnclustered ){ |
| 597 | db_multi_exec("INSERT OR IGNORE INTO unclustered VALUES(%d)", rid); |
| @@ -628,11 +628,11 @@ | |
| 628 | ** Create a new phantom with the given UUID and return its artifact ID. |
| 629 | */ |
| 630 | int content_new(const char *zUuid, int isPrivate){ |
| 631 | int rid; |
| 632 | static Stmt s1, s2, s3; |
| 633 | |
| 634 | assert( g.repositoryOpen ); |
| 635 | db_begin_transaction(); |
| 636 | if( uuid_is_shunned(zUuid) ){ |
| 637 | db_end_transaction(0); |
| 638 | return 0; |
| @@ -727,15 +727,15 @@ | |
| 727 | "SELECT 1 FROM private WHERE rid=:rid" |
| 728 | ); |
| 729 | db_bind_int(&s1, ":rid", rid); |
| 730 | rc = db_step(&s1); |
| 731 | db_reset(&s1); |
| 732 | return rc==SQLITE_ROW; |
| 733 | } |
| 734 | |
| 735 | /* |
| 736 | ** Make sure an artifact is public. |
| 737 | */ |
| 738 | void content_make_public(int rid){ |
| 739 | static Stmt s1; |
| 740 | db_static_prepare(&s1, |
| 741 | "DELETE FROM private WHERE rid=:rid" |
| @@ -758,11 +758,11 @@ | |
| 758 | ** |
| 759 | ** If srcid is a delta that depends on rid, then srcid is |
| 760 | ** converted to undeltaed text. |
| 761 | ** |
| 762 | ** If either rid or srcid contain less than 50 bytes, or if the |
| 763 | ** resulting delta does not achieve a compression of at least 25% |
| 764 | ** the rid is left untouched. |
| 765 | ** |
| 766 | ** Return 1 if a delta is made and 0 if no delta occurs. |
| 767 | */ |
| 768 | int content_deltify(int rid, int srcid, int force){ |
| @@ -883,11 +883,11 @@ | |
| 883 | zId, rid, zSrc, srcid |
| 884 | ); |
| 885 | nErr++; |
| 886 | } |
| 887 | db_finalize(&q); |
| 888 | |
| 889 | db_prepare(&q, "SELECT rid, uuid, size FROM blob ORDER BY rid"); |
| 890 | total = db_int(0, "SELECT max(rid) FROM blob"); |
| 891 | while( db_step(&q)==SQLITE_ROW ){ |
| 892 | int rid = db_column_int(&q, 0); |
| 893 | const char *zUuid = db_column_text(&q, 1); |
| @@ -1050,11 +1050,11 @@ | |
| 1050 | if( zDetail && zDetail[0] ){ |
| 1051 | fossil_print(" %s\n", zDetail); |
| 1052 | } |
| 1053 | fossil_free(zSrc); |
| 1054 | fossil_free(zDate); |
| 1055 | rc = 1; |
| 1056 | } |
| 1057 | return rc; |
| 1058 | } |
| 1059 | |
| 1060 | /* |
| @@ -1097,11 +1097,11 @@ | |
| 1097 | if( p ){ |
| 1098 | nArtifact++; |
| 1099 | nErr += check_exists(p->zBaseline, flags, p, "baseline of", 0); |
| 1100 | nErr += check_exists(p->zAttachSrc, flags, p, "file of", 0); |
| 1101 | for(i=0; i<p->nFile; i++){ |
| 1102 | nErr += check_exists(p->aFile[i].zUuid, flags, p, "file of", |
| 1103 | p->aFile[i].zName); |
| 1104 | } |
| 1105 | for(i=0; i<p->nParent; i++){ |
| 1106 | nErr += check_exists(p->azParent[i], flags, p, "parent of", 0); |
| 1107 | } |
| @@ -1115,14 +1115,14 @@ | |
| 1115 | nErr += check_exists(p->azCChild[i], flags, p, "in", 0); |
| 1116 | } |
| 1117 | for(i=0; i<p->nTag; i++){ |
| 1118 | nErr += check_exists(p->aTag[i].zUuid, flags, p, "target of", 0); |
| 1119 | } |
| 1120 | manifest_destroy(p); |
| 1121 | } |
| 1122 | } |
| 1123 | db_finalize(&q); |
| 1124 | if( nErr>0 || quietFlag==0 ){ |
| 1125 | fossil_print("%d missing or shunned references in %d control artifacts\n", |
| 1126 | nErr, nArtifact); |
| 1127 | } |
| 1128 | } |
| 1129 |
| --- src/content.c | |
| +++ src/content.c | |
| @@ -114,11 +114,11 @@ | |
| 114 | contentCache.n = 0; |
| 115 | contentCache.szTotal = 0; |
| 116 | } |
| 117 | |
| 118 | /* |
| 119 | ** Return the srcid associated with rid. Or return 0 if rid is |
| 120 | ** original content and not a delta. |
| 121 | */ |
| 122 | static int findSrcid(int rid){ |
| 123 | static Stmt q; |
| 124 | int srcid; |
| @@ -154,11 +154,11 @@ | |
| 154 | ** a phantom. |
| 155 | */ |
| 156 | int content_is_available(int rid){ |
| 157 | int srcid; |
| 158 | int depth = 0; /* Limit to recursion depth */ |
| 159 | while( depth++ < 10000000 ){ |
| 160 | if( bag_find(&contentCache.missing, rid) ){ |
| 161 | return 0; |
| 162 | } |
| 163 | if( bag_find(&contentCache.available, rid) ){ |
| 164 | return 1; |
| @@ -416,11 +416,11 @@ | |
| 416 | |
| 417 | /* Recursively dephantomize all artifacts that are derived by |
| 418 | ** delta from artifact rid and which have not already been |
| 419 | ** cross-linked. */ |
| 420 | nChildUsed = 0; |
| 421 | db_prepare(&q, |
| 422 | "SELECT rid FROM delta" |
| 423 | " WHERE srcid=%d" |
| 424 | " AND NOT EXISTS(SELECT 1 FROM mlink WHERE mid=delta.rid)", |
| 425 | rid |
| 426 | ); |
| @@ -455,11 +455,11 @@ | |
| 455 | /* |
| 456 | ** Write content into the database. Return the record ID. If the |
| 457 | ** content is already in the database, just return the record ID. |
| 458 | ** |
| 459 | ** If srcId is specified, then pBlob is delta content from |
| 460 | ** the srcId record. srcId might be a phantom. |
| 461 | ** |
| 462 | ** pBlob is normally uncompressed text. But if nBlob>0 then the |
| 463 | ** pBlob value has already been compressed and nBlob is its uncompressed |
| 464 | ** size. If nBlob>0 then zUuid must be valid. |
| 465 | ** |
| @@ -486,11 +486,11 @@ | |
| 486 | Stmt s1; |
| 487 | Blob cmpr; |
| 488 | Blob hash; |
| 489 | int markAsUnclustered = 0; |
| 490 | int isDephantomize = 0; |
| 491 | |
| 492 | assert( g.repositoryOpen ); |
| 493 | assert( pBlob!=0 ); |
| 494 | assert( srcId==0 || zUuid!=0 ); |
| 495 | if( zUuid==0 ){ |
| 496 | assert( nBlob==0 ); |
| @@ -580,18 +580,18 @@ | |
| 580 | ** really a delta. Record this fact in the delta table. |
| 581 | */ |
| 582 | if( srcId ){ |
| 583 | db_multi_exec("REPLACE INTO delta(rid,srcid) VALUES(%d,%d)", rid, srcId); |
| 584 | } |
| 585 | if( !isDephantomize && bag_find(&contentCache.missing, rid) && |
| 586 | (srcId==0 || content_is_available(srcId)) ){ |
| 587 | content_mark_available(rid); |
| 588 | } |
| 589 | if( isDephantomize ){ |
| 590 | after_dephantomize(rid, 0); |
| 591 | } |
| 592 | |
| 593 | /* Add the element to the unclustered table if has never been |
| 594 | ** previously seen. |
| 595 | */ |
| 596 | if( markAsUnclustered ){ |
| 597 | db_multi_exec("INSERT OR IGNORE INTO unclustered VALUES(%d)", rid); |
| @@ -628,11 +628,11 @@ | |
| 628 | ** Create a new phantom with the given UUID and return its artifact ID. |
| 629 | */ |
| 630 | int content_new(const char *zUuid, int isPrivate){ |
| 631 | int rid; |
| 632 | static Stmt s1, s2, s3; |
| 633 | |
| 634 | assert( g.repositoryOpen ); |
| 635 | db_begin_transaction(); |
| 636 | if( uuid_is_shunned(zUuid) ){ |
| 637 | db_end_transaction(0); |
| 638 | return 0; |
| @@ -727,15 +727,15 @@ | |
| 727 | "SELECT 1 FROM private WHERE rid=:rid" |
| 728 | ); |
| 729 | db_bind_int(&s1, ":rid", rid); |
| 730 | rc = db_step(&s1); |
| 731 | db_reset(&s1); |
| 732 | return rc==SQLITE_ROW; |
| 733 | } |
| 734 | |
| 735 | /* |
| 736 | ** Make sure an artifact is public. |
| 737 | */ |
| 738 | void content_make_public(int rid){ |
| 739 | static Stmt s1; |
| 740 | db_static_prepare(&s1, |
| 741 | "DELETE FROM private WHERE rid=:rid" |
| @@ -758,11 +758,11 @@ | |
| 758 | ** |
| 759 | ** If srcid is a delta that depends on rid, then srcid is |
| 760 | ** converted to undeltaed text. |
| 761 | ** |
| 762 | ** If either rid or srcid contain less than 50 bytes, or if the |
| 763 | ** resulting delta does not achieve a compression of at least 25% |
| 764 | ** the rid is left untouched. |
| 765 | ** |
| 766 | ** Return 1 if a delta is made and 0 if no delta occurs. |
| 767 | */ |
| 768 | int content_deltify(int rid, int srcid, int force){ |
| @@ -883,11 +883,11 @@ | |
| 883 | zId, rid, zSrc, srcid |
| 884 | ); |
| 885 | nErr++; |
| 886 | } |
| 887 | db_finalize(&q); |
| 888 | |
| 889 | db_prepare(&q, "SELECT rid, uuid, size FROM blob ORDER BY rid"); |
| 890 | total = db_int(0, "SELECT max(rid) FROM blob"); |
| 891 | while( db_step(&q)==SQLITE_ROW ){ |
| 892 | int rid = db_column_int(&q, 0); |
| 893 | const char *zUuid = db_column_text(&q, 1); |
| @@ -1050,11 +1050,11 @@ | |
| 1050 | if( zDetail && zDetail[0] ){ |
| 1051 | fossil_print(" %s\n", zDetail); |
| 1052 | } |
| 1053 | fossil_free(zSrc); |
| 1054 | fossil_free(zDate); |
| 1055 | rc = 1; |
| 1056 | } |
| 1057 | return rc; |
| 1058 | } |
| 1059 | |
| 1060 | /* |
| @@ -1097,11 +1097,11 @@ | |
| 1097 | if( p ){ |
| 1098 | nArtifact++; |
| 1099 | nErr += check_exists(p->zBaseline, flags, p, "baseline of", 0); |
| 1100 | nErr += check_exists(p->zAttachSrc, flags, p, "file of", 0); |
| 1101 | for(i=0; i<p->nFile; i++){ |
| 1102 | nErr += check_exists(p->aFile[i].zUuid, flags, p, "file of", |
| 1103 | p->aFile[i].zName); |
| 1104 | } |
| 1105 | for(i=0; i<p->nParent; i++){ |
| 1106 | nErr += check_exists(p->azParent[i], flags, p, "parent of", 0); |
| 1107 | } |
| @@ -1115,14 +1115,14 @@ | |
| 1115 | nErr += check_exists(p->azCChild[i], flags, p, "in", 0); |
| 1116 | } |
| 1117 | for(i=0; i<p->nTag; i++){ |
| 1118 | nErr += check_exists(p->aTag[i].zUuid, flags, p, "target of", 0); |
| 1119 | } |
| 1120 | manifest_destroy(p); |
| 1121 | } |
| 1122 | } |
| 1123 | db_finalize(&q); |
| 1124 | if( nErr>0 || quietFlag==0 ){ |
| 1125 | fossil_print("%d missing or shunned references in %d control artifacts\n", |
| 1126 | nErr, nArtifact); |
| 1127 | } |
| 1128 | } |
| 1129 |
+25
-25
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -51,11 +51,11 @@ | ||
| 51 | 51 | #define MC_PERMIT_HOOKS 1 /* permit hooks to execute */ |
| 52 | 52 | |
| 53 | 53 | /* |
| 54 | 54 | ** A single F-card within a manifest |
| 55 | 55 | */ |
| 56 | -struct ManifestFile { | |
| 56 | +struct ManifestFile { | |
| 57 | 57 | char *zName; /* Name of a file */ |
| 58 | 58 | char *zUuid; /* UUID of the file */ |
| 59 | 59 | char *zPerm; /* File permissions */ |
| 60 | 60 | char *zPrior; /* Prior name if the name was changed */ |
| 61 | 61 | }; |
| @@ -89,11 +89,11 @@ | ||
| 89 | 89 | ManifestFile *aFile; /* One entry for each F-card */ |
| 90 | 90 | int nParent; /* Number of parents. */ |
| 91 | 91 | int nParentAlloc; /* Slots allocated in azParent[] */ |
| 92 | 92 | char **azParent; /* UUIDs of parents. One for each P card argument */ |
| 93 | 93 | int nCherrypick; /* Number of entries in aCherrypick[] */ |
| 94 | - struct { | |
| 94 | + struct { | |
| 95 | 95 | char *zCPTarget; /* UUID of cherry-picked version w/ +|- prefix */ |
| 96 | 96 | char *zCPBase; /* UUID of cherry-pick baseline. NULL for singletons */ |
| 97 | 97 | } *aCherrypick; |
| 98 | 98 | int nCChild; /* Number of cluster children */ |
| 99 | 99 | int nCChildAlloc; /* Number of closts allocated in azCChild[] */ |
| @@ -105,11 +105,11 @@ | ||
| 105 | 105 | char *zUuid; /* UUID that the tag is applied to */ |
| 106 | 106 | char *zValue; /* Value if the tag is really a property */ |
| 107 | 107 | } *aTag; /* One for each T card */ |
| 108 | 108 | int nField; /* Number of J cards */ |
| 109 | 109 | int nFieldAlloc; /* Slots allocated in aField[] */ |
| 110 | - struct { | |
| 110 | + struct { | |
| 111 | 111 | char *zName; /* Key or field name */ |
| 112 | 112 | char *zValue; /* Value of the field */ |
| 113 | 113 | } *aField; /* One for each J card */ |
| 114 | 114 | }; |
| 115 | 115 | #endif |
| @@ -251,11 +251,11 @@ | ||
| 251 | 251 | ** Verify the Z-card checksum on the artifact, if there is such a |
| 252 | 252 | ** checksum. Return 0 if there is no Z-card. Return 1 if the Z-card |
| 253 | 253 | ** exists and is correct. Return 2 if the Z-card exists and has the wrong |
| 254 | 254 | ** value. |
| 255 | 255 | ** |
| 256 | -** 0123456789 123456789 123456789 123456789 | |
| 256 | +** 0123456789 123456789 123456789 123456789 | |
| 257 | 257 | ** Z aea84f4f863865a8d59d0384e4d2a41c |
| 258 | 258 | */ |
| 259 | 259 | static int verify_z_card(const char *z, int n){ |
| 260 | 260 | if( n<35 ) return 0; |
| 261 | 261 | if( z[n-35]!='Z' || z[n-34]!=' ' ) return 0; |
| @@ -435,11 +435,11 @@ | ||
| 435 | 435 | char *zName, *zTarget, *zSrc; |
| 436 | 436 | int nTarget = 0, nSrc = 0; |
| 437 | 437 | zName = next_token(&x, 0); |
| 438 | 438 | zTarget = next_token(&x, &nTarget); |
| 439 | 439 | zSrc = next_token(&x, &nSrc); |
| 440 | - if( zName==0 || zTarget==0 ) goto manifest_syntax_error; | |
| 440 | + if( zName==0 || zTarget==0 ) goto manifest_syntax_error; | |
| 441 | 441 | if( p->zAttachName!=0 ) goto manifest_syntax_error; |
| 442 | 442 | defossilize(zName); |
| 443 | 443 | if( !file_is_simple_pathname(zName, 0) ){ |
| 444 | 444 | SYNTAX("invalid filename on A-card"); |
| 445 | 445 | } |
| @@ -504,11 +504,11 @@ | ||
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | /* |
| 507 | 507 | ** E <timestamp> <uuid> |
| 508 | 508 | ** |
| 509 | - ** An "event" card that contains the timestamp of the event in the | |
| 509 | + ** An "event" card that contains the timestamp of the event in the | |
| 510 | 510 | ** format YYYY-MM-DDtHH:MM:SS and a unique identifier for the event. |
| 511 | 511 | ** The event timestamp is distinct from the D timestamp. The D |
| 512 | 512 | ** timestamp is when the artifact was created whereas the E timestamp |
| 513 | 513 | ** is when the specific event is said to occur. |
| 514 | 514 | */ |
| @@ -551,11 +551,11 @@ | ||
| 551 | 551 | SYNTAX("F-card old filename is not a simple path"); |
| 552 | 552 | } |
| 553 | 553 | } |
| 554 | 554 | if( p->nFile>=p->nFileAlloc ){ |
| 555 | 555 | p->nFileAlloc = p->nFileAlloc*2 + 10; |
| 556 | - p->aFile = fossil_realloc(p->aFile, | |
| 556 | + p->aFile = fossil_realloc(p->aFile, | |
| 557 | 557 | p->nFileAlloc*sizeof(p->aFile[0]) ); |
| 558 | 558 | } |
| 559 | 559 | i = p->nFile++; |
| 560 | 560 | p->aFile[i].zName = zName; |
| 561 | 561 | p->aFile[i].zUuid = zUuid; |
| @@ -743,11 +743,11 @@ | ||
| 743 | 743 | ** singleton tag, "*" to create a propagating tag, or "-" to create |
| 744 | 744 | ** anti-tag that undoes a prior "+" or blocks propagation of of |
| 745 | 745 | ** a "*". |
| 746 | 746 | ** |
| 747 | 747 | ** The tag is applied to <uuid>. If <uuid> is "*" then the tag is |
| 748 | - ** applied to the current manifest. If <value> is provided then | |
| 748 | + ** applied to the current manifest. If <value> is provided then | |
| 749 | 749 | ** the tag is really a property with the given value. |
| 750 | 750 | ** |
| 751 | 751 | ** Tags are not allowed in clusters. Multiple T lines are allowed. |
| 752 | 752 | */ |
| 753 | 753 | case 'T': { |
| @@ -1050,11 +1050,11 @@ | ||
| 1050 | 1050 | db_multi_exec( |
| 1051 | 1051 | "INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)", |
| 1052 | 1052 | p->rid, rid |
| 1053 | 1053 | ); |
| 1054 | 1054 | return 1; |
| 1055 | - } | |
| 1055 | + } | |
| 1056 | 1056 | fossil_fatal("cannot access baseline manifest %S", p->zBaseline); |
| 1057 | 1057 | } |
| 1058 | 1058 | } |
| 1059 | 1059 | return 0; |
| 1060 | 1060 | } |
| @@ -1075,11 +1075,11 @@ | ||
| 1075 | 1075 | ** |
| 1076 | 1076 | ** Return NULL for end-of-records or if there is an error. If an error |
| 1077 | 1077 | ** occurs and pErr!=0 then store 1 in *pErr. |
| 1078 | 1078 | */ |
| 1079 | 1079 | ManifestFile *manifest_file_next( |
| 1080 | - Manifest *p, | |
| 1080 | + Manifest *p, | |
| 1081 | 1081 | int *pErr |
| 1082 | 1082 | ){ |
| 1083 | 1083 | ManifestFile *pOut = 0; |
| 1084 | 1084 | if( pErr ) *pErr = 0; |
| 1085 | 1085 | if( p->pBaseline==0 ){ |
| @@ -1219,11 +1219,11 @@ | ||
| 1219 | 1219 | content_deltify(pid, fid, 0); |
| 1220 | 1220 | } |
| 1221 | 1221 | } |
| 1222 | 1222 | |
| 1223 | 1223 | /* |
| 1224 | -** Do a binary search to find a file in the p->aFile[] array. | |
| 1224 | +** Do a binary search to find a file in the p->aFile[] array. | |
| 1225 | 1225 | ** |
| 1226 | 1226 | ** As an optimization, guess that the file we seek is at index p->iFile. |
| 1227 | 1227 | ** That will usually be the case. If it is not found there, then do the |
| 1228 | 1228 | ** actual binary search. |
| 1229 | 1229 | ** |
| @@ -1263,18 +1263,18 @@ | ||
| 1263 | 1263 | /* |
| 1264 | 1264 | ** Locate a file named zName in the aFile[] array of the given manifest. |
| 1265 | 1265 | ** Return a pointer to the appropriate ManifestFile object. Return NULL |
| 1266 | 1266 | ** if not found. |
| 1267 | 1267 | ** |
| 1268 | -** This routine works even if p is a delta-manifest. The pointer | |
| 1268 | +** This routine works even if p is a delta-manifest. The pointer | |
| 1269 | 1269 | ** returned might be to the baseline. |
| 1270 | 1270 | ** |
| 1271 | 1271 | ** We assume that filenames are in sorted order and use a binary search. |
| 1272 | 1272 | */ |
| 1273 | 1273 | ManifestFile *manifest_file_seek(Manifest *p, const char *zName){ |
| 1274 | 1274 | ManifestFile *pFile; |
| 1275 | - | |
| 1275 | + | |
| 1276 | 1276 | pFile = manifest_file_seek_base(p, zName); |
| 1277 | 1277 | if( pFile && pFile->zUuid==0 ) return 0; |
| 1278 | 1278 | if( pFile==0 && p->zBaseline ){ |
| 1279 | 1279 | fetch_baseline(p, 1); |
| 1280 | 1280 | pFile = manifest_file_seek_base(p->pBaseline, zName); |
| @@ -1362,15 +1362,15 @@ | ||
| 1362 | 1362 | return; |
| 1363 | 1363 | } |
| 1364 | 1364 | isPublic = !content_is_private(cid); |
| 1365 | 1365 | |
| 1366 | 1366 | /* Try to make the parent manifest a delta from the child, if that |
| 1367 | - ** is an appropriate thing to do. For a new baseline, make the | |
| 1367 | + ** is an appropriate thing to do. For a new baseline, make the | |
| 1368 | 1368 | ** previous baseline a delta from the current baseline. |
| 1369 | 1369 | */ |
| 1370 | 1370 | if( (pParent->zBaseline==0)==(pChild->zBaseline==0) ){ |
| 1371 | - content_deltify(pid, cid, 0); | |
| 1371 | + content_deltify(pid, cid, 0); | |
| 1372 | 1372 | }else if( pChild->zBaseline==0 && pParent->zBaseline!=0 ){ |
| 1373 | 1373 | content_deltify(pParent->pBaseline->rid, cid, 0); |
| 1374 | 1374 | } |
| 1375 | 1375 | |
| 1376 | 1376 | /* Remember all children less than a few seconds younger than their parent, |
| @@ -1385,11 +1385,11 @@ | ||
| 1385 | 1385 | ); |
| 1386 | 1386 | } |
| 1387 | 1387 | |
| 1388 | 1388 | /* First look at all files in pChild, ignoring its baseline. This |
| 1389 | 1389 | ** is where most of the changes will be found. |
| 1390 | - */ | |
| 1390 | + */ | |
| 1391 | 1391 | for(i=0, pChildFile=pChild->aFile; i<pChild->nFile; i++, pChildFile++){ |
| 1392 | 1392 | int mperm = manifest_file_mperm(pChildFile); |
| 1393 | 1393 | if( pChildFile->zPrior ){ |
| 1394 | 1394 | pParentFile = manifest_file_seek(pParent, pChildFile->zPrior); |
| 1395 | 1395 | if( pParentFile ){ |
| @@ -1450,11 +1450,11 @@ | ||
| 1450 | 1450 | ** but are missing from pChild and mark them as having been deleted. */ |
| 1451 | 1451 | manifest_file_rewind(pParent); |
| 1452 | 1452 | while( (pParentFile = manifest_file_next(pParent,0))!=0 ){ |
| 1453 | 1453 | pChildFile = manifest_file_seek(pChild, pParentFile->zName); |
| 1454 | 1454 | if( pChildFile==0 && pParentFile->zUuid!=0 ){ |
| 1455 | - add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0, | |
| 1455 | + add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0, | |
| 1456 | 1456 | isPublic, 0); |
| 1457 | 1457 | } |
| 1458 | 1458 | } |
| 1459 | 1459 | } |
| 1460 | 1460 | manifest_cache_insert(*ppOther); |
| @@ -1578,11 +1578,11 @@ | ||
| 1578 | 1578 | if( once ){ |
| 1579 | 1579 | once = 0; |
| 1580 | 1580 | zTitleExpr = db_get("ticket-title-expr", "title"); |
| 1581 | 1581 | zStatusColumn = db_get("ticket-status-column", "status"); |
| 1582 | 1582 | } |
| 1583 | - zTitle = db_text("unknown", | |
| 1583 | + zTitle = db_text("unknown", | |
| 1584 | 1584 | "SELECT %s FROM ticket WHERE tkt_uuid='%s'", |
| 1585 | 1585 | zTitleExpr, pManifest->zTicketUuid |
| 1586 | 1586 | ); |
| 1587 | 1587 | if( !isNew ){ |
| 1588 | 1588 | for(i=0; i<pManifest->nField; i++){ |
| @@ -1599,11 +1599,11 @@ | ||
| 1599 | 1599 | pManifest->nField-1, pManifest->nField==2 ? "" : "s"); |
| 1600 | 1600 | } |
| 1601 | 1601 | blob_appendf(&brief, "%h ticket [%.10s].", |
| 1602 | 1602 | zNewStatus, pManifest->zTicketUuid); |
| 1603 | 1603 | }else{ |
| 1604 | - zNewStatus = db_text("unknown", | |
| 1604 | + zNewStatus = db_text("unknown", | |
| 1605 | 1605 | "SELECT %s FROM ticket WHERE tkt_uuid='%s'", |
| 1606 | 1606 | zStatusColumn, pManifest->zTicketUuid |
| 1607 | 1607 | ); |
| 1608 | 1608 | blob_appendf(&comment, "Ticket [%.10s] <i>%h</i> status still %h with " |
| 1609 | 1609 | "%d other change%s", |
| @@ -1661,11 +1661,11 @@ | ||
| 1661 | 1661 | ** |
| 1662 | 1662 | ** If the input is a control artifact, then make appropriate entries |
| 1663 | 1663 | ** in the auxiliary tables of the database in order to crosslink the |
| 1664 | 1664 | ** artifact. |
| 1665 | 1665 | ** |
| 1666 | -** If global variable g.xlinkClusterOnly is true, then ignore all | |
| 1666 | +** If global variable g.xlinkClusterOnly is true, then ignore all | |
| 1667 | 1667 | ** control artifacts other than clusters. |
| 1668 | 1668 | ** |
| 1669 | 1669 | ** This routine always resets the pContent blob before returning. |
| 1670 | 1670 | ** |
| 1671 | 1671 | ** Historical note: This routine original processed manifests only. |
| @@ -1744,11 +1744,11 @@ | ||
| 1744 | 1744 | " %d,%Q,%Q," |
| 1745 | 1745 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0)," |
| 1746 | 1746 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1747 | 1747 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),%.17g);", |
| 1748 | 1748 | TAG_DATE, rid, p->rDate, |
| 1749 | - rid, p->zUser, p->zComment, | |
| 1749 | + rid, p->zUser, p->zComment, | |
| 1750 | 1750 | TAG_BGCOLOR, rid, |
| 1751 | 1751 | TAG_USER, rid, |
| 1752 | 1752 | TAG_COMMENT, rid, p->rDate |
| 1753 | 1753 | ); |
| 1754 | 1754 | zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event" |
| @@ -1802,11 +1802,11 @@ | ||
| 1802 | 1802 | case '*': type = 2; break; /* Propagate to descendants */ |
| 1803 | 1803 | default: |
| 1804 | 1804 | fossil_error(1, "unknown tag type in manifest: %s", p->aTag); |
| 1805 | 1805 | return 0; |
| 1806 | 1806 | } |
| 1807 | - tag_insert(&p->aTag[i].zName[1], type, p->aTag[i].zValue, | |
| 1807 | + tag_insert(&p->aTag[i].zName[1], type, p->aTag[i].zValue, | |
| 1808 | 1808 | rid, p->rDate, tid); |
| 1809 | 1809 | } |
| 1810 | 1810 | } |
| 1811 | 1811 | if( parentid ){ |
| 1812 | 1812 | tag_propagate_all(parentid); |
| @@ -1843,11 +1843,11 @@ | ||
| 1843 | 1843 | " bgcolor,euser,ecomment)" |
| 1844 | 1844 | "VALUES('w',%.17g,%d,%Q,%Q," |
| 1845 | 1845 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>1)," |
| 1846 | 1846 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1847 | 1847 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));", |
| 1848 | - p->rDate, rid, p->zUser, zComment, | |
| 1848 | + p->rDate, rid, p->zUser, zComment, | |
| 1849 | 1849 | TAG_BGCOLOR, rid, |
| 1850 | 1850 | TAG_BGCOLOR, rid, |
| 1851 | 1851 | TAG_USER, rid, |
| 1852 | 1852 | TAG_COMMENT, rid |
| 1853 | 1853 | ); |
| @@ -1893,11 +1893,11 @@ | ||
| 1893 | 1893 | }else{ |
| 1894 | 1894 | db_multi_exec( |
| 1895 | 1895 | "REPLACE INTO event(type,mtime,objid,tagid,user,comment,bgcolor)" |
| 1896 | 1896 | "VALUES('e',%.17g,%d,%d,%Q,%Q," |
| 1897 | 1897 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));", |
| 1898 | - p->rEventDate, rid, tagid, p->zUser, p->zComment, | |
| 1898 | + p->rEventDate, rid, tagid, p->zUser, p->zComment, | |
| 1899 | 1899 | TAG_BGCOLOR, rid |
| 1900 | 1900 | ); |
| 1901 | 1901 | } |
| 1902 | 1902 | } |
| 1903 | 1903 | if( p->type==CFTYPE_TICKET ){ |
| @@ -1925,11 +1925,11 @@ | ||
| 1925 | 1925 | " WHERE target=%Q AND filename=%Q", |
| 1926 | 1926 | p->zAttachTarget, p->zAttachName, |
| 1927 | 1927 | p->zAttachTarget, p->zAttachName |
| 1928 | 1928 | ); |
| 1929 | 1929 | if( strlen(p->zAttachTarget)!=UUID_SIZE |
| 1930 | - || !validate16(p->zAttachTarget, UUID_SIZE) | |
| 1930 | + || !validate16(p->zAttachTarget, UUID_SIZE) | |
| 1931 | 1931 | ){ |
| 1932 | 1932 | char *zComment; |
| 1933 | 1933 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1934 | 1934 | zComment = mprintf( |
| 1935 | 1935 | "Add attachment [/artifact/%S|%h] to wiki page [%h]", |
| 1936 | 1936 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -51,11 +51,11 @@ | |
| 51 | #define MC_PERMIT_HOOKS 1 /* permit hooks to execute */ |
| 52 | |
| 53 | /* |
| 54 | ** A single F-card within a manifest |
| 55 | */ |
| 56 | struct ManifestFile { |
| 57 | char *zName; /* Name of a file */ |
| 58 | char *zUuid; /* UUID of the file */ |
| 59 | char *zPerm; /* File permissions */ |
| 60 | char *zPrior; /* Prior name if the name was changed */ |
| 61 | }; |
| @@ -89,11 +89,11 @@ | |
| 89 | ManifestFile *aFile; /* One entry for each F-card */ |
| 90 | int nParent; /* Number of parents. */ |
| 91 | int nParentAlloc; /* Slots allocated in azParent[] */ |
| 92 | char **azParent; /* UUIDs of parents. One for each P card argument */ |
| 93 | int nCherrypick; /* Number of entries in aCherrypick[] */ |
| 94 | struct { |
| 95 | char *zCPTarget; /* UUID of cherry-picked version w/ +|- prefix */ |
| 96 | char *zCPBase; /* UUID of cherry-pick baseline. NULL for singletons */ |
| 97 | } *aCherrypick; |
| 98 | int nCChild; /* Number of cluster children */ |
| 99 | int nCChildAlloc; /* Number of closts allocated in azCChild[] */ |
| @@ -105,11 +105,11 @@ | |
| 105 | char *zUuid; /* UUID that the tag is applied to */ |
| 106 | char *zValue; /* Value if the tag is really a property */ |
| 107 | } *aTag; /* One for each T card */ |
| 108 | int nField; /* Number of J cards */ |
| 109 | int nFieldAlloc; /* Slots allocated in aField[] */ |
| 110 | struct { |
| 111 | char *zName; /* Key or field name */ |
| 112 | char *zValue; /* Value of the field */ |
| 113 | } *aField; /* One for each J card */ |
| 114 | }; |
| 115 | #endif |
| @@ -251,11 +251,11 @@ | |
| 251 | ** Verify the Z-card checksum on the artifact, if there is such a |
| 252 | ** checksum. Return 0 if there is no Z-card. Return 1 if the Z-card |
| 253 | ** exists and is correct. Return 2 if the Z-card exists and has the wrong |
| 254 | ** value. |
| 255 | ** |
| 256 | ** 0123456789 123456789 123456789 123456789 |
| 257 | ** Z aea84f4f863865a8d59d0384e4d2a41c |
| 258 | */ |
| 259 | static int verify_z_card(const char *z, int n){ |
| 260 | if( n<35 ) return 0; |
| 261 | if( z[n-35]!='Z' || z[n-34]!=' ' ) return 0; |
| @@ -435,11 +435,11 @@ | |
| 435 | char *zName, *zTarget, *zSrc; |
| 436 | int nTarget = 0, nSrc = 0; |
| 437 | zName = next_token(&x, 0); |
| 438 | zTarget = next_token(&x, &nTarget); |
| 439 | zSrc = next_token(&x, &nSrc); |
| 440 | if( zName==0 || zTarget==0 ) goto manifest_syntax_error; |
| 441 | if( p->zAttachName!=0 ) goto manifest_syntax_error; |
| 442 | defossilize(zName); |
| 443 | if( !file_is_simple_pathname(zName, 0) ){ |
| 444 | SYNTAX("invalid filename on A-card"); |
| 445 | } |
| @@ -504,11 +504,11 @@ | |
| 504 | } |
| 505 | |
| 506 | /* |
| 507 | ** E <timestamp> <uuid> |
| 508 | ** |
| 509 | ** An "event" card that contains the timestamp of the event in the |
| 510 | ** format YYYY-MM-DDtHH:MM:SS and a unique identifier for the event. |
| 511 | ** The event timestamp is distinct from the D timestamp. The D |
| 512 | ** timestamp is when the artifact was created whereas the E timestamp |
| 513 | ** is when the specific event is said to occur. |
| 514 | */ |
| @@ -551,11 +551,11 @@ | |
| 551 | SYNTAX("F-card old filename is not a simple path"); |
| 552 | } |
| 553 | } |
| 554 | if( p->nFile>=p->nFileAlloc ){ |
| 555 | p->nFileAlloc = p->nFileAlloc*2 + 10; |
| 556 | p->aFile = fossil_realloc(p->aFile, |
| 557 | p->nFileAlloc*sizeof(p->aFile[0]) ); |
| 558 | } |
| 559 | i = p->nFile++; |
| 560 | p->aFile[i].zName = zName; |
| 561 | p->aFile[i].zUuid = zUuid; |
| @@ -743,11 +743,11 @@ | |
| 743 | ** singleton tag, "*" to create a propagating tag, or "-" to create |
| 744 | ** anti-tag that undoes a prior "+" or blocks propagation of of |
| 745 | ** a "*". |
| 746 | ** |
| 747 | ** The tag is applied to <uuid>. If <uuid> is "*" then the tag is |
| 748 | ** applied to the current manifest. If <value> is provided then |
| 749 | ** the tag is really a property with the given value. |
| 750 | ** |
| 751 | ** Tags are not allowed in clusters. Multiple T lines are allowed. |
| 752 | */ |
| 753 | case 'T': { |
| @@ -1050,11 +1050,11 @@ | |
| 1050 | db_multi_exec( |
| 1051 | "INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)", |
| 1052 | p->rid, rid |
| 1053 | ); |
| 1054 | return 1; |
| 1055 | } |
| 1056 | fossil_fatal("cannot access baseline manifest %S", p->zBaseline); |
| 1057 | } |
| 1058 | } |
| 1059 | return 0; |
| 1060 | } |
| @@ -1075,11 +1075,11 @@ | |
| 1075 | ** |
| 1076 | ** Return NULL for end-of-records or if there is an error. If an error |
| 1077 | ** occurs and pErr!=0 then store 1 in *pErr. |
| 1078 | */ |
| 1079 | ManifestFile *manifest_file_next( |
| 1080 | Manifest *p, |
| 1081 | int *pErr |
| 1082 | ){ |
| 1083 | ManifestFile *pOut = 0; |
| 1084 | if( pErr ) *pErr = 0; |
| 1085 | if( p->pBaseline==0 ){ |
| @@ -1219,11 +1219,11 @@ | |
| 1219 | content_deltify(pid, fid, 0); |
| 1220 | } |
| 1221 | } |
| 1222 | |
| 1223 | /* |
| 1224 | ** Do a binary search to find a file in the p->aFile[] array. |
| 1225 | ** |
| 1226 | ** As an optimization, guess that the file we seek is at index p->iFile. |
| 1227 | ** That will usually be the case. If it is not found there, then do the |
| 1228 | ** actual binary search. |
| 1229 | ** |
| @@ -1263,18 +1263,18 @@ | |
| 1263 | /* |
| 1264 | ** Locate a file named zName in the aFile[] array of the given manifest. |
| 1265 | ** Return a pointer to the appropriate ManifestFile object. Return NULL |
| 1266 | ** if not found. |
| 1267 | ** |
| 1268 | ** This routine works even if p is a delta-manifest. The pointer |
| 1269 | ** returned might be to the baseline. |
| 1270 | ** |
| 1271 | ** We assume that filenames are in sorted order and use a binary search. |
| 1272 | */ |
| 1273 | ManifestFile *manifest_file_seek(Manifest *p, const char *zName){ |
| 1274 | ManifestFile *pFile; |
| 1275 | |
| 1276 | pFile = manifest_file_seek_base(p, zName); |
| 1277 | if( pFile && pFile->zUuid==0 ) return 0; |
| 1278 | if( pFile==0 && p->zBaseline ){ |
| 1279 | fetch_baseline(p, 1); |
| 1280 | pFile = manifest_file_seek_base(p->pBaseline, zName); |
| @@ -1362,15 +1362,15 @@ | |
| 1362 | return; |
| 1363 | } |
| 1364 | isPublic = !content_is_private(cid); |
| 1365 | |
| 1366 | /* Try to make the parent manifest a delta from the child, if that |
| 1367 | ** is an appropriate thing to do. For a new baseline, make the |
| 1368 | ** previous baseline a delta from the current baseline. |
| 1369 | */ |
| 1370 | if( (pParent->zBaseline==0)==(pChild->zBaseline==0) ){ |
| 1371 | content_deltify(pid, cid, 0); |
| 1372 | }else if( pChild->zBaseline==0 && pParent->zBaseline!=0 ){ |
| 1373 | content_deltify(pParent->pBaseline->rid, cid, 0); |
| 1374 | } |
| 1375 | |
| 1376 | /* Remember all children less than a few seconds younger than their parent, |
| @@ -1385,11 +1385,11 @@ | |
| 1385 | ); |
| 1386 | } |
| 1387 | |
| 1388 | /* First look at all files in pChild, ignoring its baseline. This |
| 1389 | ** is where most of the changes will be found. |
| 1390 | */ |
| 1391 | for(i=0, pChildFile=pChild->aFile; i<pChild->nFile; i++, pChildFile++){ |
| 1392 | int mperm = manifest_file_mperm(pChildFile); |
| 1393 | if( pChildFile->zPrior ){ |
| 1394 | pParentFile = manifest_file_seek(pParent, pChildFile->zPrior); |
| 1395 | if( pParentFile ){ |
| @@ -1450,11 +1450,11 @@ | |
| 1450 | ** but are missing from pChild and mark them as having been deleted. */ |
| 1451 | manifest_file_rewind(pParent); |
| 1452 | while( (pParentFile = manifest_file_next(pParent,0))!=0 ){ |
| 1453 | pChildFile = manifest_file_seek(pChild, pParentFile->zName); |
| 1454 | if( pChildFile==0 && pParentFile->zUuid!=0 ){ |
| 1455 | add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0, |
| 1456 | isPublic, 0); |
| 1457 | } |
| 1458 | } |
| 1459 | } |
| 1460 | manifest_cache_insert(*ppOther); |
| @@ -1578,11 +1578,11 @@ | |
| 1578 | if( once ){ |
| 1579 | once = 0; |
| 1580 | zTitleExpr = db_get("ticket-title-expr", "title"); |
| 1581 | zStatusColumn = db_get("ticket-status-column", "status"); |
| 1582 | } |
| 1583 | zTitle = db_text("unknown", |
| 1584 | "SELECT %s FROM ticket WHERE tkt_uuid='%s'", |
| 1585 | zTitleExpr, pManifest->zTicketUuid |
| 1586 | ); |
| 1587 | if( !isNew ){ |
| 1588 | for(i=0; i<pManifest->nField; i++){ |
| @@ -1599,11 +1599,11 @@ | |
| 1599 | pManifest->nField-1, pManifest->nField==2 ? "" : "s"); |
| 1600 | } |
| 1601 | blob_appendf(&brief, "%h ticket [%.10s].", |
| 1602 | zNewStatus, pManifest->zTicketUuid); |
| 1603 | }else{ |
| 1604 | zNewStatus = db_text("unknown", |
| 1605 | "SELECT %s FROM ticket WHERE tkt_uuid='%s'", |
| 1606 | zStatusColumn, pManifest->zTicketUuid |
| 1607 | ); |
| 1608 | blob_appendf(&comment, "Ticket [%.10s] <i>%h</i> status still %h with " |
| 1609 | "%d other change%s", |
| @@ -1661,11 +1661,11 @@ | |
| 1661 | ** |
| 1662 | ** If the input is a control artifact, then make appropriate entries |
| 1663 | ** in the auxiliary tables of the database in order to crosslink the |
| 1664 | ** artifact. |
| 1665 | ** |
| 1666 | ** If global variable g.xlinkClusterOnly is true, then ignore all |
| 1667 | ** control artifacts other than clusters. |
| 1668 | ** |
| 1669 | ** This routine always resets the pContent blob before returning. |
| 1670 | ** |
| 1671 | ** Historical note: This routine original processed manifests only. |
| @@ -1744,11 +1744,11 @@ | |
| 1744 | " %d,%Q,%Q," |
| 1745 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0)," |
| 1746 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1747 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),%.17g);", |
| 1748 | TAG_DATE, rid, p->rDate, |
| 1749 | rid, p->zUser, p->zComment, |
| 1750 | TAG_BGCOLOR, rid, |
| 1751 | TAG_USER, rid, |
| 1752 | TAG_COMMENT, rid, p->rDate |
| 1753 | ); |
| 1754 | zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event" |
| @@ -1802,11 +1802,11 @@ | |
| 1802 | case '*': type = 2; break; /* Propagate to descendants */ |
| 1803 | default: |
| 1804 | fossil_error(1, "unknown tag type in manifest: %s", p->aTag); |
| 1805 | return 0; |
| 1806 | } |
| 1807 | tag_insert(&p->aTag[i].zName[1], type, p->aTag[i].zValue, |
| 1808 | rid, p->rDate, tid); |
| 1809 | } |
| 1810 | } |
| 1811 | if( parentid ){ |
| 1812 | tag_propagate_all(parentid); |
| @@ -1843,11 +1843,11 @@ | |
| 1843 | " bgcolor,euser,ecomment)" |
| 1844 | "VALUES('w',%.17g,%d,%Q,%Q," |
| 1845 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>1)," |
| 1846 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1847 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));", |
| 1848 | p->rDate, rid, p->zUser, zComment, |
| 1849 | TAG_BGCOLOR, rid, |
| 1850 | TAG_BGCOLOR, rid, |
| 1851 | TAG_USER, rid, |
| 1852 | TAG_COMMENT, rid |
| 1853 | ); |
| @@ -1893,11 +1893,11 @@ | |
| 1893 | }else{ |
| 1894 | db_multi_exec( |
| 1895 | "REPLACE INTO event(type,mtime,objid,tagid,user,comment,bgcolor)" |
| 1896 | "VALUES('e',%.17g,%d,%d,%Q,%Q," |
| 1897 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));", |
| 1898 | p->rEventDate, rid, tagid, p->zUser, p->zComment, |
| 1899 | TAG_BGCOLOR, rid |
| 1900 | ); |
| 1901 | } |
| 1902 | } |
| 1903 | if( p->type==CFTYPE_TICKET ){ |
| @@ -1925,11 +1925,11 @@ | |
| 1925 | " WHERE target=%Q AND filename=%Q", |
| 1926 | p->zAttachTarget, p->zAttachName, |
| 1927 | p->zAttachTarget, p->zAttachName |
| 1928 | ); |
| 1929 | if( strlen(p->zAttachTarget)!=UUID_SIZE |
| 1930 | || !validate16(p->zAttachTarget, UUID_SIZE) |
| 1931 | ){ |
| 1932 | char *zComment; |
| 1933 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1934 | zComment = mprintf( |
| 1935 | "Add attachment [/artifact/%S|%h] to wiki page [%h]", |
| 1936 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -51,11 +51,11 @@ | |
| 51 | #define MC_PERMIT_HOOKS 1 /* permit hooks to execute */ |
| 52 | |
| 53 | /* |
| 54 | ** A single F-card within a manifest |
| 55 | */ |
| 56 | struct ManifestFile { |
| 57 | char *zName; /* Name of a file */ |
| 58 | char *zUuid; /* UUID of the file */ |
| 59 | char *zPerm; /* File permissions */ |
| 60 | char *zPrior; /* Prior name if the name was changed */ |
| 61 | }; |
| @@ -89,11 +89,11 @@ | |
| 89 | ManifestFile *aFile; /* One entry for each F-card */ |
| 90 | int nParent; /* Number of parents. */ |
| 91 | int nParentAlloc; /* Slots allocated in azParent[] */ |
| 92 | char **azParent; /* UUIDs of parents. One for each P card argument */ |
| 93 | int nCherrypick; /* Number of entries in aCherrypick[] */ |
| 94 | struct { |
| 95 | char *zCPTarget; /* UUID of cherry-picked version w/ +|- prefix */ |
| 96 | char *zCPBase; /* UUID of cherry-pick baseline. NULL for singletons */ |
| 97 | } *aCherrypick; |
| 98 | int nCChild; /* Number of cluster children */ |
| 99 | int nCChildAlloc; /* Number of closts allocated in azCChild[] */ |
| @@ -105,11 +105,11 @@ | |
| 105 | char *zUuid; /* UUID that the tag is applied to */ |
| 106 | char *zValue; /* Value if the tag is really a property */ |
| 107 | } *aTag; /* One for each T card */ |
| 108 | int nField; /* Number of J cards */ |
| 109 | int nFieldAlloc; /* Slots allocated in aField[] */ |
| 110 | struct { |
| 111 | char *zName; /* Key or field name */ |
| 112 | char *zValue; /* Value of the field */ |
| 113 | } *aField; /* One for each J card */ |
| 114 | }; |
| 115 | #endif |
| @@ -251,11 +251,11 @@ | |
| 251 | ** Verify the Z-card checksum on the artifact, if there is such a |
| 252 | ** checksum. Return 0 if there is no Z-card. Return 1 if the Z-card |
| 253 | ** exists and is correct. Return 2 if the Z-card exists and has the wrong |
| 254 | ** value. |
| 255 | ** |
| 256 | ** 0123456789 123456789 123456789 123456789 |
| 257 | ** Z aea84f4f863865a8d59d0384e4d2a41c |
| 258 | */ |
| 259 | static int verify_z_card(const char *z, int n){ |
| 260 | if( n<35 ) return 0; |
| 261 | if( z[n-35]!='Z' || z[n-34]!=' ' ) return 0; |
| @@ -435,11 +435,11 @@ | |
| 435 | char *zName, *zTarget, *zSrc; |
| 436 | int nTarget = 0, nSrc = 0; |
| 437 | zName = next_token(&x, 0); |
| 438 | zTarget = next_token(&x, &nTarget); |
| 439 | zSrc = next_token(&x, &nSrc); |
| 440 | if( zName==0 || zTarget==0 ) goto manifest_syntax_error; |
| 441 | if( p->zAttachName!=0 ) goto manifest_syntax_error; |
| 442 | defossilize(zName); |
| 443 | if( !file_is_simple_pathname(zName, 0) ){ |
| 444 | SYNTAX("invalid filename on A-card"); |
| 445 | } |
| @@ -504,11 +504,11 @@ | |
| 504 | } |
| 505 | |
| 506 | /* |
| 507 | ** E <timestamp> <uuid> |
| 508 | ** |
| 509 | ** An "event" card that contains the timestamp of the event in the |
| 510 | ** format YYYY-MM-DDtHH:MM:SS and a unique identifier for the event. |
| 511 | ** The event timestamp is distinct from the D timestamp. The D |
| 512 | ** timestamp is when the artifact was created whereas the E timestamp |
| 513 | ** is when the specific event is said to occur. |
| 514 | */ |
| @@ -551,11 +551,11 @@ | |
| 551 | SYNTAX("F-card old filename is not a simple path"); |
| 552 | } |
| 553 | } |
| 554 | if( p->nFile>=p->nFileAlloc ){ |
| 555 | p->nFileAlloc = p->nFileAlloc*2 + 10; |
| 556 | p->aFile = fossil_realloc(p->aFile, |
| 557 | p->nFileAlloc*sizeof(p->aFile[0]) ); |
| 558 | } |
| 559 | i = p->nFile++; |
| 560 | p->aFile[i].zName = zName; |
| 561 | p->aFile[i].zUuid = zUuid; |
| @@ -743,11 +743,11 @@ | |
| 743 | ** singleton tag, "*" to create a propagating tag, or "-" to create |
| 744 | ** anti-tag that undoes a prior "+" or blocks propagation of of |
| 745 | ** a "*". |
| 746 | ** |
| 747 | ** The tag is applied to <uuid>. If <uuid> is "*" then the tag is |
| 748 | ** applied to the current manifest. If <value> is provided then |
| 749 | ** the tag is really a property with the given value. |
| 750 | ** |
| 751 | ** Tags are not allowed in clusters. Multiple T lines are allowed. |
| 752 | */ |
| 753 | case 'T': { |
| @@ -1050,11 +1050,11 @@ | |
| 1050 | db_multi_exec( |
| 1051 | "INSERT OR IGNORE INTO orphan(rid, baseline) VALUES(%d,%d)", |
| 1052 | p->rid, rid |
| 1053 | ); |
| 1054 | return 1; |
| 1055 | } |
| 1056 | fossil_fatal("cannot access baseline manifest %S", p->zBaseline); |
| 1057 | } |
| 1058 | } |
| 1059 | return 0; |
| 1060 | } |
| @@ -1075,11 +1075,11 @@ | |
| 1075 | ** |
| 1076 | ** Return NULL for end-of-records or if there is an error. If an error |
| 1077 | ** occurs and pErr!=0 then store 1 in *pErr. |
| 1078 | */ |
| 1079 | ManifestFile *manifest_file_next( |
| 1080 | Manifest *p, |
| 1081 | int *pErr |
| 1082 | ){ |
| 1083 | ManifestFile *pOut = 0; |
| 1084 | if( pErr ) *pErr = 0; |
| 1085 | if( p->pBaseline==0 ){ |
| @@ -1219,11 +1219,11 @@ | |
| 1219 | content_deltify(pid, fid, 0); |
| 1220 | } |
| 1221 | } |
| 1222 | |
| 1223 | /* |
| 1224 | ** Do a binary search to find a file in the p->aFile[] array. |
| 1225 | ** |
| 1226 | ** As an optimization, guess that the file we seek is at index p->iFile. |
| 1227 | ** That will usually be the case. If it is not found there, then do the |
| 1228 | ** actual binary search. |
| 1229 | ** |
| @@ -1263,18 +1263,18 @@ | |
| 1263 | /* |
| 1264 | ** Locate a file named zName in the aFile[] array of the given manifest. |
| 1265 | ** Return a pointer to the appropriate ManifestFile object. Return NULL |
| 1266 | ** if not found. |
| 1267 | ** |
| 1268 | ** This routine works even if p is a delta-manifest. The pointer |
| 1269 | ** returned might be to the baseline. |
| 1270 | ** |
| 1271 | ** We assume that filenames are in sorted order and use a binary search. |
| 1272 | */ |
| 1273 | ManifestFile *manifest_file_seek(Manifest *p, const char *zName){ |
| 1274 | ManifestFile *pFile; |
| 1275 | |
| 1276 | pFile = manifest_file_seek_base(p, zName); |
| 1277 | if( pFile && pFile->zUuid==0 ) return 0; |
| 1278 | if( pFile==0 && p->zBaseline ){ |
| 1279 | fetch_baseline(p, 1); |
| 1280 | pFile = manifest_file_seek_base(p->pBaseline, zName); |
| @@ -1362,15 +1362,15 @@ | |
| 1362 | return; |
| 1363 | } |
| 1364 | isPublic = !content_is_private(cid); |
| 1365 | |
| 1366 | /* Try to make the parent manifest a delta from the child, if that |
| 1367 | ** is an appropriate thing to do. For a new baseline, make the |
| 1368 | ** previous baseline a delta from the current baseline. |
| 1369 | */ |
| 1370 | if( (pParent->zBaseline==0)==(pChild->zBaseline==0) ){ |
| 1371 | content_deltify(pid, cid, 0); |
| 1372 | }else if( pChild->zBaseline==0 && pParent->zBaseline!=0 ){ |
| 1373 | content_deltify(pParent->pBaseline->rid, cid, 0); |
| 1374 | } |
| 1375 | |
| 1376 | /* Remember all children less than a few seconds younger than their parent, |
| @@ -1385,11 +1385,11 @@ | |
| 1385 | ); |
| 1386 | } |
| 1387 | |
| 1388 | /* First look at all files in pChild, ignoring its baseline. This |
| 1389 | ** is where most of the changes will be found. |
| 1390 | */ |
| 1391 | for(i=0, pChildFile=pChild->aFile; i<pChild->nFile; i++, pChildFile++){ |
| 1392 | int mperm = manifest_file_mperm(pChildFile); |
| 1393 | if( pChildFile->zPrior ){ |
| 1394 | pParentFile = manifest_file_seek(pParent, pChildFile->zPrior); |
| 1395 | if( pParentFile ){ |
| @@ -1450,11 +1450,11 @@ | |
| 1450 | ** but are missing from pChild and mark them as having been deleted. */ |
| 1451 | manifest_file_rewind(pParent); |
| 1452 | while( (pParentFile = manifest_file_next(pParent,0))!=0 ){ |
| 1453 | pChildFile = manifest_file_seek(pChild, pParentFile->zName); |
| 1454 | if( pChildFile==0 && pParentFile->zUuid!=0 ){ |
| 1455 | add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0, |
| 1456 | isPublic, 0); |
| 1457 | } |
| 1458 | } |
| 1459 | } |
| 1460 | manifest_cache_insert(*ppOther); |
| @@ -1578,11 +1578,11 @@ | |
| 1578 | if( once ){ |
| 1579 | once = 0; |
| 1580 | zTitleExpr = db_get("ticket-title-expr", "title"); |
| 1581 | zStatusColumn = db_get("ticket-status-column", "status"); |
| 1582 | } |
| 1583 | zTitle = db_text("unknown", |
| 1584 | "SELECT %s FROM ticket WHERE tkt_uuid='%s'", |
| 1585 | zTitleExpr, pManifest->zTicketUuid |
| 1586 | ); |
| 1587 | if( !isNew ){ |
| 1588 | for(i=0; i<pManifest->nField; i++){ |
| @@ -1599,11 +1599,11 @@ | |
| 1599 | pManifest->nField-1, pManifest->nField==2 ? "" : "s"); |
| 1600 | } |
| 1601 | blob_appendf(&brief, "%h ticket [%.10s].", |
| 1602 | zNewStatus, pManifest->zTicketUuid); |
| 1603 | }else{ |
| 1604 | zNewStatus = db_text("unknown", |
| 1605 | "SELECT %s FROM ticket WHERE tkt_uuid='%s'", |
| 1606 | zStatusColumn, pManifest->zTicketUuid |
| 1607 | ); |
| 1608 | blob_appendf(&comment, "Ticket [%.10s] <i>%h</i> status still %h with " |
| 1609 | "%d other change%s", |
| @@ -1661,11 +1661,11 @@ | |
| 1661 | ** |
| 1662 | ** If the input is a control artifact, then make appropriate entries |
| 1663 | ** in the auxiliary tables of the database in order to crosslink the |
| 1664 | ** artifact. |
| 1665 | ** |
| 1666 | ** If global variable g.xlinkClusterOnly is true, then ignore all |
| 1667 | ** control artifacts other than clusters. |
| 1668 | ** |
| 1669 | ** This routine always resets the pContent blob before returning. |
| 1670 | ** |
| 1671 | ** Historical note: This routine original processed manifests only. |
| @@ -1744,11 +1744,11 @@ | |
| 1744 | " %d,%Q,%Q," |
| 1745 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>0)," |
| 1746 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1747 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d),%.17g);", |
| 1748 | TAG_DATE, rid, p->rDate, |
| 1749 | rid, p->zUser, p->zComment, |
| 1750 | TAG_BGCOLOR, rid, |
| 1751 | TAG_USER, rid, |
| 1752 | TAG_COMMENT, rid, p->rDate |
| 1753 | ); |
| 1754 | zCom = db_text(0, "SELECT coalesce(ecomment, comment) FROM event" |
| @@ -1802,11 +1802,11 @@ | |
| 1802 | case '*': type = 2; break; /* Propagate to descendants */ |
| 1803 | default: |
| 1804 | fossil_error(1, "unknown tag type in manifest: %s", p->aTag); |
| 1805 | return 0; |
| 1806 | } |
| 1807 | tag_insert(&p->aTag[i].zName[1], type, p->aTag[i].zValue, |
| 1808 | rid, p->rDate, tid); |
| 1809 | } |
| 1810 | } |
| 1811 | if( parentid ){ |
| 1812 | tag_propagate_all(parentid); |
| @@ -1843,11 +1843,11 @@ | |
| 1843 | " bgcolor,euser,ecomment)" |
| 1844 | "VALUES('w',%.17g,%d,%Q,%Q," |
| 1845 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d AND tagtype>1)," |
| 1846 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d)," |
| 1847 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));", |
| 1848 | p->rDate, rid, p->zUser, zComment, |
| 1849 | TAG_BGCOLOR, rid, |
| 1850 | TAG_BGCOLOR, rid, |
| 1851 | TAG_USER, rid, |
| 1852 | TAG_COMMENT, rid |
| 1853 | ); |
| @@ -1893,11 +1893,11 @@ | |
| 1893 | }else{ |
| 1894 | db_multi_exec( |
| 1895 | "REPLACE INTO event(type,mtime,objid,tagid,user,comment,bgcolor)" |
| 1896 | "VALUES('e',%.17g,%d,%d,%Q,%Q," |
| 1897 | " (SELECT value FROM tagxref WHERE tagid=%d AND rid=%d));", |
| 1898 | p->rEventDate, rid, tagid, p->zUser, p->zComment, |
| 1899 | TAG_BGCOLOR, rid |
| 1900 | ); |
| 1901 | } |
| 1902 | } |
| 1903 | if( p->type==CFTYPE_TICKET ){ |
| @@ -1925,11 +1925,11 @@ | |
| 1925 | " WHERE target=%Q AND filename=%Q", |
| 1926 | p->zAttachTarget, p->zAttachName, |
| 1927 | p->zAttachTarget, p->zAttachName |
| 1928 | ); |
| 1929 | if( strlen(p->zAttachTarget)!=UUID_SIZE |
| 1930 | || !validate16(p->zAttachTarget, UUID_SIZE) |
| 1931 | ){ |
| 1932 | char *zComment; |
| 1933 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1934 | zComment = mprintf( |
| 1935 | "Add attachment [/artifact/%S|%h] to wiki page [%h]", |
| 1936 |
+1
-1
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -859,11 +859,11 @@ | ||
| 859 | 859 | fwrite(z, 1, n, toStdErr ? stderr : stdout); |
| 860 | 860 | fflush(toStdErr ? stderr : stdout); |
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | /* |
| 864 | -** Force the standard output cursor to move to the beginning | |
| 864 | +** Force the standard output cursor to move to the beginning | |
| 865 | 865 | ** of a line, if it is not there already. |
| 866 | 866 | */ |
| 867 | 867 | void fossil_force_newline(void){ |
| 868 | 868 | if( g.cgiOutput==0 && stdoutAtBOL==0 ) fossil_puts("\n", 0); |
| 869 | 869 | } |
| 870 | 870 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -859,11 +859,11 @@ | |
| 859 | fwrite(z, 1, n, toStdErr ? stderr : stdout); |
| 860 | fflush(toStdErr ? stderr : stdout); |
| 861 | } |
| 862 | |
| 863 | /* |
| 864 | ** Force the standard output cursor to move to the beginning |
| 865 | ** of a line, if it is not there already. |
| 866 | */ |
| 867 | void fossil_force_newline(void){ |
| 868 | if( g.cgiOutput==0 && stdoutAtBOL==0 ) fossil_puts("\n", 0); |
| 869 | } |
| 870 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -859,11 +859,11 @@ | |
| 859 | fwrite(z, 1, n, toStdErr ? stderr : stdout); |
| 860 | fflush(toStdErr ? stderr : stdout); |
| 861 | } |
| 862 | |
| 863 | /* |
| 864 | ** Force the standard output cursor to move to the beginning |
| 865 | ** of a line, if it is not there already. |
| 866 | */ |
| 867 | void fossil_force_newline(void){ |
| 868 | if( g.cgiOutput==0 && stdoutAtBOL==0 ) fossil_puts("\n", 0); |
| 869 | } |
| 870 |
+12
-12
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -47,18 +47,18 @@ | ||
| 47 | 47 | @ mtime INTEGER, -- When added. Seconds since 1970 |
| 48 | 48 | @ scom TEXT -- Optional text explaining why the shun occurred |
| 49 | 49 | @ ); |
| 50 | 50 | @ |
| 51 | 51 | @ -- Artifacts that should not be pushed are stored in the "private" |
| 52 | -@ -- table. | |
| 52 | +@ -- table. | |
| 53 | 53 | @ -- |
| 54 | 54 | @ CREATE TABLE IF NOT EXISTS private(rid INTEGER PRIMARY KEY); |
| 55 | 55 | @ |
| 56 | 56 | @ -- Some ticket content (such as the originators email address or contact |
| 57 | 57 | @ -- information) needs to be obscured to protect privacy. This is achieved |
| 58 | 58 | @ -- by storing an SHA1 hash of the content. For display, the hash is |
| 59 | -@ -- mapped back into the original text using this table. | |
| 59 | +@ -- mapped back into the original text using this table. | |
| 60 | 60 | @ -- |
| 61 | 61 | @ -- This table contains sensitive information and should not be shared |
| 62 | 62 | @ -- with unauthorized users. |
| 63 | 63 | @ -- |
| 64 | 64 | @ CREATE TABLE IF NOT EXISTS concealed( |
| @@ -153,11 +153,11 @@ | ||
| 153 | 153 | db_multi_exec( |
| 154 | 154 | "ALTER TABLE concealed ADD COLUMN mtime INTEGER;" |
| 155 | 155 | "UPDATE concealed SET mtime=now();" |
| 156 | 156 | ); |
| 157 | 157 | } |
| 158 | -} | |
| 158 | +} | |
| 159 | 159 | |
| 160 | 160 | /* |
| 161 | 161 | ** Variables used to store state information about an on-going "rebuild" |
| 162 | 162 | ** or "deconstruct". |
| 163 | 163 | */ |
| @@ -227,11 +227,11 @@ | ||
| 227 | 227 | if( size!=blob_size(pBase) ){ |
| 228 | 228 | db_multi_exec( |
| 229 | 229 | "UPDATE blob SET size=%d WHERE rid=%d", blob_size(pBase), rid |
| 230 | 230 | ); |
| 231 | 231 | } |
| 232 | - | |
| 232 | + | |
| 233 | 233 | /* Find all children of artifact rid */ |
| 234 | 234 | db_static_prepare(&q1, "SELECT rid FROM delta WHERE srcid=:rid"); |
| 235 | 235 | db_bind_int(&q1, ":rid", rid); |
| 236 | 236 | bag_init(&children); |
| 237 | 237 | while( db_step(&q1)==SQLITE_ROW ){ |
| @@ -240,11 +240,11 @@ | ||
| 240 | 240 | bag_insert(&children, cid); |
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | nChild = bag_count(&children); |
| 244 | 244 | db_reset(&q1); |
| 245 | - | |
| 245 | + | |
| 246 | 246 | /* Crosslink the artifact */ |
| 247 | 247 | if( nChild==0 ){ |
| 248 | 248 | pUse = pBase; |
| 249 | 249 | }else{ |
| 250 | 250 | blob_copy(©, pBase); |
| @@ -262,11 +262,11 @@ | ||
| 262 | 262 | free(zUuid); |
| 263 | 263 | blob_reset(pUse); |
| 264 | 264 | } |
| 265 | 265 | assert( blob_is_reset(pUse) ); |
| 266 | 266 | rebuild_step_done(rid); |
| 267 | - | |
| 267 | + | |
| 268 | 268 | /* Call all children recursively */ |
| 269 | 269 | rid = 0; |
| 270 | 270 | for(cid=bag_first(&children), i=1; cid; cid=bag_next(&children, cid), i++){ |
| 271 | 271 | static Stmt q2; |
| 272 | 272 | int sz; |
| @@ -687,11 +687,11 @@ | ||
| 687 | 687 | db_close(1); |
| 688 | 688 | db_open_repository(g.zRepositoryName); |
| 689 | 689 | } |
| 690 | 690 | db_begin_transaction(); |
| 691 | 691 | create_cluster(); |
| 692 | - db_end_transaction(0); | |
| 692 | + db_end_transaction(0); | |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | 695 | /* |
| 696 | 696 | ** COMMAND: test-clusters |
| 697 | 697 | ** |
| @@ -700,11 +700,11 @@ | ||
| 700 | 700 | */ |
| 701 | 701 | void test_clusters_cmd(void){ |
| 702 | 702 | Bag pending; |
| 703 | 703 | Stmt q; |
| 704 | 704 | int n; |
| 705 | - | |
| 705 | + | |
| 706 | 706 | db_find_and_open_repository(0, 2); |
| 707 | 707 | bag_init(&pending); |
| 708 | 708 | db_multi_exec( |
| 709 | 709 | "CREATE TEMP TABLE xdone(x INTEGER PRIMARY KEY);" |
| 710 | 710 | "INSERT INTO xdone SELECT rid FROM unclustered;" |
| @@ -722,11 +722,11 @@ | ||
| 722 | 722 | db_finalize(&q); |
| 723 | 723 | while( bag_count(&pending)>0 ){ |
| 724 | 724 | Manifest *p; |
| 725 | 725 | int rid = bag_first(&pending); |
| 726 | 726 | int i; |
| 727 | - | |
| 727 | + | |
| 728 | 728 | bag_remove(&pending, rid); |
| 729 | 729 | p = manifest_get(rid, CFTYPE_CLUSTER, 0); |
| 730 | 730 | if( p==0 ){ |
| 731 | 731 | fossil_fatal("bad cluster: rid=%d", rid); |
| 732 | 732 | } |
| @@ -865,11 +865,11 @@ | ||
| 865 | 865 | recon_read_dir(zSubpath); |
| 866 | 866 | } |
| 867 | 867 | blob_init(&path, 0, 0); |
| 868 | 868 | blob_appendf(&path, "%s", zSubpath); |
| 869 | 869 | if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){ |
| 870 | - fossil_fatal("some unknown error occurred while reading \"%s\"", | |
| 870 | + fossil_fatal("some unknown error occurred while reading \"%s\"", | |
| 871 | 871 | blob_str(&path)); |
| 872 | 872 | } |
| 873 | 873 | content_put(&aContent); |
| 874 | 874 | blob_reset(&path); |
| 875 | 875 | blob_reset(&aContent); |
| @@ -922,11 +922,11 @@ | ||
| 922 | 922 | /* Skip the verify_before_commit() step on a reconstruct. Most artifacts |
| 923 | 923 | ** will have been changed and verification therefore takes a really, really |
| 924 | 924 | ** long time. |
| 925 | 925 | */ |
| 926 | 926 | verify_cancel(); |
| 927 | - | |
| 927 | + | |
| 928 | 928 | db_end_transaction(0); |
| 929 | 929 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 930 | 930 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 931 | 931 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 932 | 932 | fossil_print("admin-user: %s (initial password is \"%s\")\n", g.zLogin, zPassword); |
| @@ -942,11 +942,11 @@ | ||
| 942 | 942 | ** writes all artifacts to the file system. The DESTINATION directory |
| 943 | 943 | ** will be populated with subdirectories AA and files AA/BBBBBBBBB.., where |
| 944 | 944 | ** AABBBBBBBBB.. is the 40 character artifact ID, AA the first 2 characters. |
| 945 | 945 | ** If -L|--prefixlength is given, the length (default 2) of the directory |
| 946 | 946 | ** prefix can be set to 0,1,..,9 characters. |
| 947 | -** | |
| 947 | +** | |
| 948 | 948 | ** Options: |
| 949 | 949 | ** -R|--repository REPOSITORY deconstruct given REPOSITORY |
| 950 | 950 | ** -L|--prefixlength N set the length of the names of the DESTINATION |
| 951 | 951 | ** subdirectories to N |
| 952 | 952 | ** --private Include private artifacts. |
| 953 | 953 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -47,18 +47,18 @@ | |
| 47 | @ mtime INTEGER, -- When added. Seconds since 1970 |
| 48 | @ scom TEXT -- Optional text explaining why the shun occurred |
| 49 | @ ); |
| 50 | @ |
| 51 | @ -- Artifacts that should not be pushed are stored in the "private" |
| 52 | @ -- table. |
| 53 | @ -- |
| 54 | @ CREATE TABLE IF NOT EXISTS private(rid INTEGER PRIMARY KEY); |
| 55 | @ |
| 56 | @ -- Some ticket content (such as the originators email address or contact |
| 57 | @ -- information) needs to be obscured to protect privacy. This is achieved |
| 58 | @ -- by storing an SHA1 hash of the content. For display, the hash is |
| 59 | @ -- mapped back into the original text using this table. |
| 60 | @ -- |
| 61 | @ -- This table contains sensitive information and should not be shared |
| 62 | @ -- with unauthorized users. |
| 63 | @ -- |
| 64 | @ CREATE TABLE IF NOT EXISTS concealed( |
| @@ -153,11 +153,11 @@ | |
| 153 | db_multi_exec( |
| 154 | "ALTER TABLE concealed ADD COLUMN mtime INTEGER;" |
| 155 | "UPDATE concealed SET mtime=now();" |
| 156 | ); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | /* |
| 161 | ** Variables used to store state information about an on-going "rebuild" |
| 162 | ** or "deconstruct". |
| 163 | */ |
| @@ -227,11 +227,11 @@ | |
| 227 | if( size!=blob_size(pBase) ){ |
| 228 | db_multi_exec( |
| 229 | "UPDATE blob SET size=%d WHERE rid=%d", blob_size(pBase), rid |
| 230 | ); |
| 231 | } |
| 232 | |
| 233 | /* Find all children of artifact rid */ |
| 234 | db_static_prepare(&q1, "SELECT rid FROM delta WHERE srcid=:rid"); |
| 235 | db_bind_int(&q1, ":rid", rid); |
| 236 | bag_init(&children); |
| 237 | while( db_step(&q1)==SQLITE_ROW ){ |
| @@ -240,11 +240,11 @@ | |
| 240 | bag_insert(&children, cid); |
| 241 | } |
| 242 | } |
| 243 | nChild = bag_count(&children); |
| 244 | db_reset(&q1); |
| 245 | |
| 246 | /* Crosslink the artifact */ |
| 247 | if( nChild==0 ){ |
| 248 | pUse = pBase; |
| 249 | }else{ |
| 250 | blob_copy(©, pBase); |
| @@ -262,11 +262,11 @@ | |
| 262 | free(zUuid); |
| 263 | blob_reset(pUse); |
| 264 | } |
| 265 | assert( blob_is_reset(pUse) ); |
| 266 | rebuild_step_done(rid); |
| 267 | |
| 268 | /* Call all children recursively */ |
| 269 | rid = 0; |
| 270 | for(cid=bag_first(&children), i=1; cid; cid=bag_next(&children, cid), i++){ |
| 271 | static Stmt q2; |
| 272 | int sz; |
| @@ -687,11 +687,11 @@ | |
| 687 | db_close(1); |
| 688 | db_open_repository(g.zRepositoryName); |
| 689 | } |
| 690 | db_begin_transaction(); |
| 691 | create_cluster(); |
| 692 | db_end_transaction(0); |
| 693 | } |
| 694 | |
| 695 | /* |
| 696 | ** COMMAND: test-clusters |
| 697 | ** |
| @@ -700,11 +700,11 @@ | |
| 700 | */ |
| 701 | void test_clusters_cmd(void){ |
| 702 | Bag pending; |
| 703 | Stmt q; |
| 704 | int n; |
| 705 | |
| 706 | db_find_and_open_repository(0, 2); |
| 707 | bag_init(&pending); |
| 708 | db_multi_exec( |
| 709 | "CREATE TEMP TABLE xdone(x INTEGER PRIMARY KEY);" |
| 710 | "INSERT INTO xdone SELECT rid FROM unclustered;" |
| @@ -722,11 +722,11 @@ | |
| 722 | db_finalize(&q); |
| 723 | while( bag_count(&pending)>0 ){ |
| 724 | Manifest *p; |
| 725 | int rid = bag_first(&pending); |
| 726 | int i; |
| 727 | |
| 728 | bag_remove(&pending, rid); |
| 729 | p = manifest_get(rid, CFTYPE_CLUSTER, 0); |
| 730 | if( p==0 ){ |
| 731 | fossil_fatal("bad cluster: rid=%d", rid); |
| 732 | } |
| @@ -865,11 +865,11 @@ | |
| 865 | recon_read_dir(zSubpath); |
| 866 | } |
| 867 | blob_init(&path, 0, 0); |
| 868 | blob_appendf(&path, "%s", zSubpath); |
| 869 | if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){ |
| 870 | fossil_fatal("some unknown error occurred while reading \"%s\"", |
| 871 | blob_str(&path)); |
| 872 | } |
| 873 | content_put(&aContent); |
| 874 | blob_reset(&path); |
| 875 | blob_reset(&aContent); |
| @@ -922,11 +922,11 @@ | |
| 922 | /* Skip the verify_before_commit() step on a reconstruct. Most artifacts |
| 923 | ** will have been changed and verification therefore takes a really, really |
| 924 | ** long time. |
| 925 | */ |
| 926 | verify_cancel(); |
| 927 | |
| 928 | db_end_transaction(0); |
| 929 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 930 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 931 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 932 | fossil_print("admin-user: %s (initial password is \"%s\")\n", g.zLogin, zPassword); |
| @@ -942,11 +942,11 @@ | |
| 942 | ** writes all artifacts to the file system. The DESTINATION directory |
| 943 | ** will be populated with subdirectories AA and files AA/BBBBBBBBB.., where |
| 944 | ** AABBBBBBBBB.. is the 40 character artifact ID, AA the first 2 characters. |
| 945 | ** If -L|--prefixlength is given, the length (default 2) of the directory |
| 946 | ** prefix can be set to 0,1,..,9 characters. |
| 947 | ** |
| 948 | ** Options: |
| 949 | ** -R|--repository REPOSITORY deconstruct given REPOSITORY |
| 950 | ** -L|--prefixlength N set the length of the names of the DESTINATION |
| 951 | ** subdirectories to N |
| 952 | ** --private Include private artifacts. |
| 953 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -47,18 +47,18 @@ | |
| 47 | @ mtime INTEGER, -- When added. Seconds since 1970 |
| 48 | @ scom TEXT -- Optional text explaining why the shun occurred |
| 49 | @ ); |
| 50 | @ |
| 51 | @ -- Artifacts that should not be pushed are stored in the "private" |
| 52 | @ -- table. |
| 53 | @ -- |
| 54 | @ CREATE TABLE IF NOT EXISTS private(rid INTEGER PRIMARY KEY); |
| 55 | @ |
| 56 | @ -- Some ticket content (such as the originators email address or contact |
| 57 | @ -- information) needs to be obscured to protect privacy. This is achieved |
| 58 | @ -- by storing an SHA1 hash of the content. For display, the hash is |
| 59 | @ -- mapped back into the original text using this table. |
| 60 | @ -- |
| 61 | @ -- This table contains sensitive information and should not be shared |
| 62 | @ -- with unauthorized users. |
| 63 | @ -- |
| 64 | @ CREATE TABLE IF NOT EXISTS concealed( |
| @@ -153,11 +153,11 @@ | |
| 153 | db_multi_exec( |
| 154 | "ALTER TABLE concealed ADD COLUMN mtime INTEGER;" |
| 155 | "UPDATE concealed SET mtime=now();" |
| 156 | ); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | /* |
| 161 | ** Variables used to store state information about an on-going "rebuild" |
| 162 | ** or "deconstruct". |
| 163 | */ |
| @@ -227,11 +227,11 @@ | |
| 227 | if( size!=blob_size(pBase) ){ |
| 228 | db_multi_exec( |
| 229 | "UPDATE blob SET size=%d WHERE rid=%d", blob_size(pBase), rid |
| 230 | ); |
| 231 | } |
| 232 | |
| 233 | /* Find all children of artifact rid */ |
| 234 | db_static_prepare(&q1, "SELECT rid FROM delta WHERE srcid=:rid"); |
| 235 | db_bind_int(&q1, ":rid", rid); |
| 236 | bag_init(&children); |
| 237 | while( db_step(&q1)==SQLITE_ROW ){ |
| @@ -240,11 +240,11 @@ | |
| 240 | bag_insert(&children, cid); |
| 241 | } |
| 242 | } |
| 243 | nChild = bag_count(&children); |
| 244 | db_reset(&q1); |
| 245 | |
| 246 | /* Crosslink the artifact */ |
| 247 | if( nChild==0 ){ |
| 248 | pUse = pBase; |
| 249 | }else{ |
| 250 | blob_copy(©, pBase); |
| @@ -262,11 +262,11 @@ | |
| 262 | free(zUuid); |
| 263 | blob_reset(pUse); |
| 264 | } |
| 265 | assert( blob_is_reset(pUse) ); |
| 266 | rebuild_step_done(rid); |
| 267 | |
| 268 | /* Call all children recursively */ |
| 269 | rid = 0; |
| 270 | for(cid=bag_first(&children), i=1; cid; cid=bag_next(&children, cid), i++){ |
| 271 | static Stmt q2; |
| 272 | int sz; |
| @@ -687,11 +687,11 @@ | |
| 687 | db_close(1); |
| 688 | db_open_repository(g.zRepositoryName); |
| 689 | } |
| 690 | db_begin_transaction(); |
| 691 | create_cluster(); |
| 692 | db_end_transaction(0); |
| 693 | } |
| 694 | |
| 695 | /* |
| 696 | ** COMMAND: test-clusters |
| 697 | ** |
| @@ -700,11 +700,11 @@ | |
| 700 | */ |
| 701 | void test_clusters_cmd(void){ |
| 702 | Bag pending; |
| 703 | Stmt q; |
| 704 | int n; |
| 705 | |
| 706 | db_find_and_open_repository(0, 2); |
| 707 | bag_init(&pending); |
| 708 | db_multi_exec( |
| 709 | "CREATE TEMP TABLE xdone(x INTEGER PRIMARY KEY);" |
| 710 | "INSERT INTO xdone SELECT rid FROM unclustered;" |
| @@ -722,11 +722,11 @@ | |
| 722 | db_finalize(&q); |
| 723 | while( bag_count(&pending)>0 ){ |
| 724 | Manifest *p; |
| 725 | int rid = bag_first(&pending); |
| 726 | int i; |
| 727 | |
| 728 | bag_remove(&pending, rid); |
| 729 | p = manifest_get(rid, CFTYPE_CLUSTER, 0); |
| 730 | if( p==0 ){ |
| 731 | fossil_fatal("bad cluster: rid=%d", rid); |
| 732 | } |
| @@ -865,11 +865,11 @@ | |
| 865 | recon_read_dir(zSubpath); |
| 866 | } |
| 867 | blob_init(&path, 0, 0); |
| 868 | blob_appendf(&path, "%s", zSubpath); |
| 869 | if( blob_read_from_file(&aContent, blob_str(&path))==-1 ){ |
| 870 | fossil_fatal("some unknown error occurred while reading \"%s\"", |
| 871 | blob_str(&path)); |
| 872 | } |
| 873 | content_put(&aContent); |
| 874 | blob_reset(&path); |
| 875 | blob_reset(&aContent); |
| @@ -922,11 +922,11 @@ | |
| 922 | /* Skip the verify_before_commit() step on a reconstruct. Most artifacts |
| 923 | ** will have been changed and verification therefore takes a really, really |
| 924 | ** long time. |
| 925 | */ |
| 926 | verify_cancel(); |
| 927 | |
| 928 | db_end_transaction(0); |
| 929 | fossil_print("project-id: %s\n", db_get("project-code", 0)); |
| 930 | fossil_print("server-id: %s\n", db_get("server-code", 0)); |
| 931 | zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin); |
| 932 | fossil_print("admin-user: %s (initial password is \"%s\")\n", g.zLogin, zPassword); |
| @@ -942,11 +942,11 @@ | |
| 942 | ** writes all artifacts to the file system. The DESTINATION directory |
| 943 | ** will be populated with subdirectories AA and files AA/BBBBBBBBB.., where |
| 944 | ** AABBBBBBBBB.. is the 40 character artifact ID, AA the first 2 characters. |
| 945 | ** If -L|--prefixlength is given, the length (default 2) of the directory |
| 946 | ** prefix can be set to 0,1,..,9 characters. |
| 947 | ** |
| 948 | ** Options: |
| 949 | ** -R|--repository REPOSITORY deconstruct given REPOSITORY |
| 950 | ** -L|--prefixlength N set the length of the names of the DESTINATION |
| 951 | ** subdirectories to N |
| 952 | ** --private Include private artifacts. |
| 953 |
+2
-2
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -975,19 +975,19 @@ | ||
| 975 | 975 | @ including user "nobody", as long as (1) the User-Agent string in the |
| 976 | 976 | @ HTTP header indicates that the request is coming from an actual human |
| 977 | 977 | @ being and not a a robot or spider and (2) the user agent is able to |
| 978 | 978 | @ run Javascript in order to set the href= attribute of hyperlinks. Bots |
| 979 | 979 | @ and spiders can forge a User-Agent string that makes them seem to be a |
| 980 | - @ normal browser and they can run javascript just like browsers. But most | |
| 980 | + @ normal browser and they can run javascript just like browsers. But most | |
| 981 | 981 | @ bots do not go to that much trouble so this is normally an effective defense.</p> |
| 982 | 982 | @ |
| 983 | 983 | @ <p>You do not normally want a bot to walk your entire repository because |
| 984 | 984 | @ if it does, your server will end up computing diffs and annotations for |
| 985 | 985 | @ every historical version of every file and creating ZIPs and tarballs of |
| 986 | 986 | @ every historical check-in, which can use a lot of CPU and bandwidth |
| 987 | 987 | @ even for relatively small projects.</p> |
| 988 | - @ | |
| 988 | + @ | |
| 989 | 989 | @ <p>Additional parameters that control this behavior:</p> |
| 990 | 990 | @ <blockquote> |
| 991 | 991 | onoff_attribute("Require mouse movement before enabling hyperlinks", |
| 992 | 992 | "auto-hyperlink-mouseover", "ahmo", 0, 0); |
| 993 | 993 | @ <br> |
| 994 | 994 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -975,19 +975,19 @@ | |
| 975 | @ including user "nobody", as long as (1) the User-Agent string in the |
| 976 | @ HTTP header indicates that the request is coming from an actual human |
| 977 | @ being and not a a robot or spider and (2) the user agent is able to |
| 978 | @ run Javascript in order to set the href= attribute of hyperlinks. Bots |
| 979 | @ and spiders can forge a User-Agent string that makes them seem to be a |
| 980 | @ normal browser and they can run javascript just like browsers. But most |
| 981 | @ bots do not go to that much trouble so this is normally an effective defense.</p> |
| 982 | @ |
| 983 | @ <p>You do not normally want a bot to walk your entire repository because |
| 984 | @ if it does, your server will end up computing diffs and annotations for |
| 985 | @ every historical version of every file and creating ZIPs and tarballs of |
| 986 | @ every historical check-in, which can use a lot of CPU and bandwidth |
| 987 | @ even for relatively small projects.</p> |
| 988 | @ |
| 989 | @ <p>Additional parameters that control this behavior:</p> |
| 990 | @ <blockquote> |
| 991 | onoff_attribute("Require mouse movement before enabling hyperlinks", |
| 992 | "auto-hyperlink-mouseover", "ahmo", 0, 0); |
| 993 | @ <br> |
| 994 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -975,19 +975,19 @@ | |
| 975 | @ including user "nobody", as long as (1) the User-Agent string in the |
| 976 | @ HTTP header indicates that the request is coming from an actual human |
| 977 | @ being and not a a robot or spider and (2) the user agent is able to |
| 978 | @ run Javascript in order to set the href= attribute of hyperlinks. Bots |
| 979 | @ and spiders can forge a User-Agent string that makes them seem to be a |
| 980 | @ normal browser and they can run javascript just like browsers. But most |
| 981 | @ bots do not go to that much trouble so this is normally an effective defense.</p> |
| 982 | @ |
| 983 | @ <p>You do not normally want a bot to walk your entire repository because |
| 984 | @ if it does, your server will end up computing diffs and annotations for |
| 985 | @ every historical version of every file and creating ZIPs and tarballs of |
| 986 | @ every historical check-in, which can use a lot of CPU and bandwidth |
| 987 | @ even for relatively small projects.</p> |
| 988 | @ |
| 989 | @ <p>Additional parameters that control this behavior:</p> |
| 990 | @ <blockquote> |
| 991 | onoff_attribute("Require mouse movement before enabling hyperlinks", |
| 992 | "auto-hyperlink-mouseover", "ahmo", 0, 0); |
| 993 | @ <br> |
| 994 |
+5
-5
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -247,14 +247,14 @@ | ||
| 247 | 247 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 248 | 248 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 249 | 249 | static Stmt qbranch; |
| 250 | 250 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 251 | 251 | int vid = 0; /* Current checkout version */ |
| 252 | - int dateFormat = 0; /* 0: HH:MM 1: HH:MM:SS | |
| 252 | + int dateFormat = 0; /* 0: HH:MM 1: HH:MM:SS | |
| 253 | 253 | 2: YYYY-MM-DD HH:MM |
| 254 | 254 | 3: YYMMDD HH:MM */ |
| 255 | - | |
| 255 | + | |
| 256 | 256 | if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){ |
| 257 | 257 | vid = db_lget_int("checkout", 0); |
| 258 | 258 | } |
| 259 | 259 | zPrevDate[0] = 0; |
| 260 | 260 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| @@ -591,11 +591,11 @@ | ||
| 591 | 591 | ){ |
| 592 | 592 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 593 | 593 | GraphRow *pRow; |
| 594 | 594 | int i; |
| 595 | 595 | char cSep; |
| 596 | - | |
| 596 | + | |
| 597 | 597 | @ <script type="text/JavaScript"> |
| 598 | 598 | @ /* <![CDATA[ */ |
| 599 | 599 | @ var railPitch=%d(pGraph->iRailPitch); |
| 600 | 600 | |
| 601 | 601 | /* the rowinfo[] array contains all the information needed to generate |
| @@ -2240,11 +2240,11 @@ | ||
| 2240 | 2240 | if(showYearTotal){ |
| 2241 | 2241 | rowClass = ++nRowNumber % 2; |
| 2242 | 2242 | @ <tr class='row%d(rowClass)'> |
| 2243 | 2243 | @ <td></td> |
| 2244 | 2244 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2245 | - @</tr> | |
| 2245 | + @</tr> | |
| 2246 | 2246 | } |
| 2247 | 2247 | nEventsPerYear = 0; |
| 2248 | 2248 | memcpy(zPrevYear,zTimeframe,4); |
| 2249 | 2249 | rowClass = ++nRowNumber % 2; |
| 2250 | 2250 | @ <tr class='row%d(rowClass)'> |
| @@ -2304,11 +2304,11 @@ | ||
| 2304 | 2304 | /* Add final year total separator. */ |
| 2305 | 2305 | rowClass = ++nRowNumber % 2; |
| 2306 | 2306 | @ <tr class='row%d(rowClass)'> |
| 2307 | 2307 | @ <td></td> |
| 2308 | 2308 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2309 | - @</tr> | |
| 2309 | + @</tr> | |
| 2310 | 2310 | } |
| 2311 | 2311 | @ </tbody></table> |
| 2312 | 2312 | if(nEventTotal){ |
| 2313 | 2313 | char const * zAvgLabel = includeMonth ? "month" : "year"; |
| 2314 | 2314 | int nAvg = iterations ? (nEventTotal/iterations) : 0; |
| 2315 | 2315 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -247,14 +247,14 @@ | |
| 247 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 248 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 249 | static Stmt qbranch; |
| 250 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 251 | int vid = 0; /* Current checkout version */ |
| 252 | int dateFormat = 0; /* 0: HH:MM 1: HH:MM:SS |
| 253 | 2: YYYY-MM-DD HH:MM |
| 254 | 3: YYMMDD HH:MM */ |
| 255 | |
| 256 | if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){ |
| 257 | vid = db_lget_int("checkout", 0); |
| 258 | } |
| 259 | zPrevDate[0] = 0; |
| 260 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| @@ -591,11 +591,11 @@ | |
| 591 | ){ |
| 592 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 593 | GraphRow *pRow; |
| 594 | int i; |
| 595 | char cSep; |
| 596 | |
| 597 | @ <script type="text/JavaScript"> |
| 598 | @ /* <![CDATA[ */ |
| 599 | @ var railPitch=%d(pGraph->iRailPitch); |
| 600 | |
| 601 | /* the rowinfo[] array contains all the information needed to generate |
| @@ -2240,11 +2240,11 @@ | |
| 2240 | if(showYearTotal){ |
| 2241 | rowClass = ++nRowNumber % 2; |
| 2242 | @ <tr class='row%d(rowClass)'> |
| 2243 | @ <td></td> |
| 2244 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2245 | @</tr> |
| 2246 | } |
| 2247 | nEventsPerYear = 0; |
| 2248 | memcpy(zPrevYear,zTimeframe,4); |
| 2249 | rowClass = ++nRowNumber % 2; |
| 2250 | @ <tr class='row%d(rowClass)'> |
| @@ -2304,11 +2304,11 @@ | |
| 2304 | /* Add final year total separator. */ |
| 2305 | rowClass = ++nRowNumber % 2; |
| 2306 | @ <tr class='row%d(rowClass)'> |
| 2307 | @ <td></td> |
| 2308 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2309 | @</tr> |
| 2310 | } |
| 2311 | @ </tbody></table> |
| 2312 | if(nEventTotal){ |
| 2313 | char const * zAvgLabel = includeMonth ? "month" : "year"; |
| 2314 | int nAvg = iterations ? (nEventTotal/iterations) : 0; |
| 2315 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -247,14 +247,14 @@ | |
| 247 | int fchngQueryInit = 0; /* True if fchngQuery is initialized */ |
| 248 | Stmt fchngQuery; /* Query for file changes on check-ins */ |
| 249 | static Stmt qbranch; |
| 250 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 251 | int vid = 0; /* Current checkout version */ |
| 252 | int dateFormat = 0; /* 0: HH:MM 1: HH:MM:SS |
| 253 | 2: YYYY-MM-DD HH:MM |
| 254 | 3: YYMMDD HH:MM */ |
| 255 | |
| 256 | if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){ |
| 257 | vid = db_lget_int("checkout", 0); |
| 258 | } |
| 259 | zPrevDate[0] = 0; |
| 260 | mxWikiLen = db_get_int("timeline-max-comment", 0); |
| @@ -591,11 +591,11 @@ | |
| 591 | ){ |
| 592 | if( pGraph && pGraph->nErr==0 && pGraph->nRow>0 ){ |
| 593 | GraphRow *pRow; |
| 594 | int i; |
| 595 | char cSep; |
| 596 | |
| 597 | @ <script type="text/JavaScript"> |
| 598 | @ /* <![CDATA[ */ |
| 599 | @ var railPitch=%d(pGraph->iRailPitch); |
| 600 | |
| 601 | /* the rowinfo[] array contains all the information needed to generate |
| @@ -2240,11 +2240,11 @@ | |
| 2240 | if(showYearTotal){ |
| 2241 | rowClass = ++nRowNumber % 2; |
| 2242 | @ <tr class='row%d(rowClass)'> |
| 2243 | @ <td></td> |
| 2244 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2245 | @</tr> |
| 2246 | } |
| 2247 | nEventsPerYear = 0; |
| 2248 | memcpy(zPrevYear,zTimeframe,4); |
| 2249 | rowClass = ++nRowNumber % 2; |
| 2250 | @ <tr class='row%d(rowClass)'> |
| @@ -2304,11 +2304,11 @@ | |
| 2304 | /* Add final year total separator. */ |
| 2305 | rowClass = ++nRowNumber % 2; |
| 2306 | @ <tr class='row%d(rowClass)'> |
| 2307 | @ <td></td> |
| 2308 | @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td> |
| 2309 | @</tr> |
| 2310 | } |
| 2311 | @ </tbody></table> |
| 2312 | if(nEventTotal){ |
| 2313 | char const * zAvgLabel = includeMonth ? "month" : "year"; |
| 2314 | int nAvg = iterations ? (nEventTotal/iterations) : 0; |
| 2315 |
+13
-13
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -222,11 +222,11 @@ | ||
| 222 | 222 | zBody = db_get("sandbox",zBody); |
| 223 | 223 | zMimetype = db_get("sandbox-mimetype","text/x-fossil-wiki"); |
| 224 | 224 | rid = 0; |
| 225 | 225 | }else{ |
| 226 | 226 | zTag = mprintf("wiki-%s", zPageName); |
| 227 | - rid = db_int(0, | |
| 227 | + rid = db_int(0, | |
| 228 | 228 | "SELECT rid FROM tagxref" |
| 229 | 229 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 230 | 230 | " ORDER BY mtime DESC", zTag |
| 231 | 231 | ); |
| 232 | 232 | free(zTag); |
| @@ -260,11 +260,11 @@ | ||
| 260 | 260 | style_submenu_element("Attach", "Add An Attachment", |
| 261 | 261 | "%s/attachadd?page=%T&from=%s/wiki%%3fname=%T", |
| 262 | 262 | g.zTop, zPageName, g.zTop, zPageName); |
| 263 | 263 | } |
| 264 | 264 | if( rid && g.perm.ApndWiki ){ |
| 265 | - style_submenu_element("Append", "Add A Comment", | |
| 265 | + style_submenu_element("Append", "Add A Comment", | |
| 266 | 266 | "%s/wikiappend?name=%T&mimetype=%s", |
| 267 | 267 | g.zTop, zPageName, zMimetype); |
| 268 | 268 | } |
| 269 | 269 | if( g.perm.Hyperlink ){ |
| 270 | 270 | style_submenu_element("History", "History", "%s/whistory?name=%T", |
| @@ -381,11 +381,11 @@ | ||
| 381 | 381 | zBody = db_get("sandbox",""); |
| 382 | 382 | zMimetype = db_get("sandbox-mimetype","text/x-fossil-wiki"); |
| 383 | 383 | } |
| 384 | 384 | }else{ |
| 385 | 385 | zTag = mprintf("wiki-%s", zPageName); |
| 386 | - rid = db_int(0, | |
| 386 | + rid = db_int(0, | |
| 387 | 387 | "SELECT rid FROM tagxref" |
| 388 | 388 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 389 | 389 | " ORDER BY mtime DESC", zTag |
| 390 | 390 | ); |
| 391 | 391 | free(zTag); |
| @@ -462,11 +462,11 @@ | ||
| 462 | 462 | if( !isWysiwyg ){ |
| 463 | 463 | /* Traditional markup-only editing */ |
| 464 | 464 | form_begin(0, "%R/wikiedit"); |
| 465 | 465 | @ <div> |
| 466 | 466 | mimetype_option_menu(zMimetype); |
| 467 | - @ <br /><textarea name="w" class="wikiedit" cols="80" | |
| 467 | + @ <br /><textarea name="w" class="wikiedit" cols="80" | |
| 468 | 468 | @ rows="%d(n)" wrap="virtual">%h(zBody)</textarea> |
| 469 | 469 | @ <br /> |
| 470 | 470 | if( db_get_boolean("wysiwyg-wiki", 0) ){ |
| 471 | 471 | @ <input type="submit" name="edit-wysiwyg" value="Wysiwyg Editor" |
| 472 | 472 | @ onclick='return confirm("Switching to WYSIWYG-mode\nwill erase your markup\nedits. Continue?")' /> |
| @@ -514,11 +514,11 @@ | ||
| 514 | 514 | const char *zMimetype; |
| 515 | 515 | login_check_credentials(); |
| 516 | 516 | if( !g.perm.NewWiki ){ |
| 517 | 517 | login_needed(); |
| 518 | 518 | return; |
| 519 | - } | |
| 519 | + } | |
| 520 | 520 | zName = PD("name",""); |
| 521 | 521 | zMimetype = wiki_filter_mimetypes(P("mimetype")); |
| 522 | 522 | if( zName[0] && wiki_name_is_wellformed((const unsigned char *)zName) ){ |
| 523 | 523 | if( fossil_strcmp(zMimetype,"text/x-fossil-wiki")==0 |
| 524 | 524 | && db_get_boolean("wysiwyg-wiki", 0) |
| @@ -557,11 +557,11 @@ | ||
| 557 | 557 | zDate = db_text(0, "SELECT datetime('now')"); |
| 558 | 558 | zRemark = PD("r",""); |
| 559 | 559 | zUser = PD("u",g.zLogin); |
| 560 | 560 | if( fossil_strcmp(zMimetype, "text/x-fossil-wiki")==0 ){ |
| 561 | 561 | zId = db_text(0, "SELECT lower(hex(randomblob(8)))"); |
| 562 | - blob_appendf(p, "\n\n<hr><div id=\"%s\"><i>On %s UTC %h", | |
| 562 | + blob_appendf(p, "\n\n<hr><div id=\"%s\"><i>On %s UTC %h", | |
| 563 | 563 | zId, zDate, g.zLogin); |
| 564 | 564 | if( zUser[0] && fossil_strcmp(zUser,g.zLogin) ){ |
| 565 | 565 | blob_appendf(p, " (claiming to be %h)", zUser); |
| 566 | 566 | } |
| 567 | 567 | blob_appendf(p, " added:</i><br />\n%s</div id=\"%s\">", zRemark, zId); |
| @@ -601,11 +601,11 @@ | ||
| 601 | 601 | zMimetype = wiki_filter_mimetypes(P("mimetype")); |
| 602 | 602 | if( check_name(zPageName) ) return; |
| 603 | 603 | isSandbox = is_sandbox(zPageName); |
| 604 | 604 | if( !isSandbox ){ |
| 605 | 605 | zTag = mprintf("wiki-%s", zPageName); |
| 606 | - rid = db_int(0, | |
| 606 | + rid = db_int(0, | |
| 607 | 607 | "SELECT rid FROM tagxref" |
| 608 | 608 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 609 | 609 | " ORDER BY mtime DESC", zTag |
| 610 | 610 | ); |
| 611 | 611 | free(zTag); |
| @@ -690,11 +690,11 @@ | ||
| 690 | 690 | @ <input type="hidden" name="mimetype" value="%h(zMimetype)" /> |
| 691 | 691 | @ Your Name: |
| 692 | 692 | @ <input type="text" name="u" size="20" value="%h(zUser)" /><br /> |
| 693 | 693 | zFormat = mimetype_common_name(zMimetype); |
| 694 | 694 | @ Comment to append (formatted as %s(zFormat)):<br /> |
| 695 | - @ <textarea name="r" class="wikiedit" cols="80" | |
| 695 | + @ <textarea name="r" class="wikiedit" cols="80" | |
| 696 | 696 | @ rows="10" wrap="virtual">%h(PD("r",""))</textarea> |
| 697 | 697 | @ <br /> |
| 698 | 698 | @ <input type="submit" name="preview" value="Preview Your Comment" /> |
| 699 | 699 | @ <input type="submit" name="submit" value="Append Your Changes" /> |
| 700 | 700 | @ <input type="submit" name="cancel" value="Cancel" /> |
| @@ -809,11 +809,11 @@ | ||
| 809 | 809 | ** - tagxref (whatever that really is!) |
| 810 | 810 | ** |
| 811 | 811 | ** Used by wcontent_page() and the JSON wiki code. |
| 812 | 812 | */ |
| 813 | 813 | void wiki_prepare_page_list( Stmt * pStmt ){ |
| 814 | - db_prepare(pStmt, | |
| 814 | + db_prepare(pStmt, | |
| 815 | 815 | "SELECT" |
| 816 | 816 | " substr(tagname, 6) as name," |
| 817 | 817 | " (SELECT value FROM tagxref WHERE tagid=tag.tagid ORDER BY mtime DESC) as tagXref" |
| 818 | 818 | " FROM tag WHERE tagname GLOB 'wiki-*'" |
| 819 | 819 | " ORDER BY lower(tagname) /*sort*/" |
| @@ -866,11 +866,11 @@ | ||
| 866 | 866 | login_check_credentials(); |
| 867 | 867 | if( !g.perm.RdWiki ){ login_needed(); return; } |
| 868 | 868 | zTitle = PD("title","*"); |
| 869 | 869 | style_header("Wiki Pages Found"); |
| 870 | 870 | @ <ul> |
| 871 | - db_prepare(&q, | |
| 871 | + db_prepare(&q, | |
| 872 | 872 | "SELECT substr(tagname, 6, 1000) FROM tag WHERE tagname like 'wiki-%%%q%%'" |
| 873 | 873 | " ORDER BY lower(tagname) /*sort*/" , |
| 874 | 874 | zTitle); |
| 875 | 875 | while( db_step(&q)==SQLITE_ROW ){ |
| 876 | 876 | const char *zName = db_column_text(&q, 0); |
| @@ -917,11 +917,11 @@ | ||
| 917 | 917 | @ surrounded on both sides by two or more spaces or by a tab. Only a single |
| 918 | 918 | @ level of enumeration list is supported by wiki. For nested lists or for |
| 919 | 919 | @ enumerations that count using letters or roman numerials, use HTML.</p></li> |
| 920 | 920 | @ <li> <p><span class="wikiruleHead">Indented Paragraphs</span>. |
| 921 | 921 | @ Any paragraph that begins with two or more spaces or a tab and |
| 922 | - @ which is not a bullet or enumeration list item is rendered | |
| 922 | + @ which is not a bullet or enumeration list item is rendered | |
| 923 | 923 | @ indented. Only a single level of indentation is supported by wiki; use |
| 924 | 924 | @ HTML for deeper indentation.</p></li> |
| 925 | 925 | @ <li> <p><span class="wikiruleHead">Hyperlinks</span>. |
| 926 | 926 | @ Text within square brackets ("[...]") becomes a hyperlink. The |
| 927 | 927 | @ target can be a wiki page name, the artifact ID of a check-in or ticket, |
| @@ -1062,11 +1062,11 @@ | ||
| 1062 | 1062 | } |
| 1063 | 1063 | zPageName = g.argv[3]; |
| 1064 | 1064 | rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x" |
| 1065 | 1065 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'" |
| 1066 | 1066 | " ORDER BY x.mtime DESC LIMIT 1", |
| 1067 | - zPageName | |
| 1067 | + zPageName | |
| 1068 | 1068 | ); |
| 1069 | 1069 | if( (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0 ){ |
| 1070 | 1070 | zBody = pWiki->zWiki; |
| 1071 | 1071 | } |
| 1072 | 1072 | if( zBody==0 ){ |
| @@ -1110,11 +1110,11 @@ | ||
| 1110 | 1110 | } |
| 1111 | 1111 | fossil_fatal("delete not yet implemented."); |
| 1112 | 1112 | }else |
| 1113 | 1113 | if( strncmp(g.argv[2],"list",n)==0 ){ |
| 1114 | 1114 | Stmt q; |
| 1115 | - db_prepare(&q, | |
| 1115 | + db_prepare(&q, | |
| 1116 | 1116 | "SELECT substr(tagname, 6) FROM tag WHERE tagname GLOB 'wiki-*'" |
| 1117 | 1117 | " ORDER BY lower(tagname) /*sort*/" |
| 1118 | 1118 | ); |
| 1119 | 1119 | while( db_step(&q)==SQLITE_ROW ){ |
| 1120 | 1120 | const char *zName = db_column_text(&q, 0); |
| 1121 | 1121 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -222,11 +222,11 @@ | |
| 222 | zBody = db_get("sandbox",zBody); |
| 223 | zMimetype = db_get("sandbox-mimetype","text/x-fossil-wiki"); |
| 224 | rid = 0; |
| 225 | }else{ |
| 226 | zTag = mprintf("wiki-%s", zPageName); |
| 227 | rid = db_int(0, |
| 228 | "SELECT rid FROM tagxref" |
| 229 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 230 | " ORDER BY mtime DESC", zTag |
| 231 | ); |
| 232 | free(zTag); |
| @@ -260,11 +260,11 @@ | |
| 260 | style_submenu_element("Attach", "Add An Attachment", |
| 261 | "%s/attachadd?page=%T&from=%s/wiki%%3fname=%T", |
| 262 | g.zTop, zPageName, g.zTop, zPageName); |
| 263 | } |
| 264 | if( rid && g.perm.ApndWiki ){ |
| 265 | style_submenu_element("Append", "Add A Comment", |
| 266 | "%s/wikiappend?name=%T&mimetype=%s", |
| 267 | g.zTop, zPageName, zMimetype); |
| 268 | } |
| 269 | if( g.perm.Hyperlink ){ |
| 270 | style_submenu_element("History", "History", "%s/whistory?name=%T", |
| @@ -381,11 +381,11 @@ | |
| 381 | zBody = db_get("sandbox",""); |
| 382 | zMimetype = db_get("sandbox-mimetype","text/x-fossil-wiki"); |
| 383 | } |
| 384 | }else{ |
| 385 | zTag = mprintf("wiki-%s", zPageName); |
| 386 | rid = db_int(0, |
| 387 | "SELECT rid FROM tagxref" |
| 388 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 389 | " ORDER BY mtime DESC", zTag |
| 390 | ); |
| 391 | free(zTag); |
| @@ -462,11 +462,11 @@ | |
| 462 | if( !isWysiwyg ){ |
| 463 | /* Traditional markup-only editing */ |
| 464 | form_begin(0, "%R/wikiedit"); |
| 465 | @ <div> |
| 466 | mimetype_option_menu(zMimetype); |
| 467 | @ <br /><textarea name="w" class="wikiedit" cols="80" |
| 468 | @ rows="%d(n)" wrap="virtual">%h(zBody)</textarea> |
| 469 | @ <br /> |
| 470 | if( db_get_boolean("wysiwyg-wiki", 0) ){ |
| 471 | @ <input type="submit" name="edit-wysiwyg" value="Wysiwyg Editor" |
| 472 | @ onclick='return confirm("Switching to WYSIWYG-mode\nwill erase your markup\nedits. Continue?")' /> |
| @@ -514,11 +514,11 @@ | |
| 514 | const char *zMimetype; |
| 515 | login_check_credentials(); |
| 516 | if( !g.perm.NewWiki ){ |
| 517 | login_needed(); |
| 518 | return; |
| 519 | } |
| 520 | zName = PD("name",""); |
| 521 | zMimetype = wiki_filter_mimetypes(P("mimetype")); |
| 522 | if( zName[0] && wiki_name_is_wellformed((const unsigned char *)zName) ){ |
| 523 | if( fossil_strcmp(zMimetype,"text/x-fossil-wiki")==0 |
| 524 | && db_get_boolean("wysiwyg-wiki", 0) |
| @@ -557,11 +557,11 @@ | |
| 557 | zDate = db_text(0, "SELECT datetime('now')"); |
| 558 | zRemark = PD("r",""); |
| 559 | zUser = PD("u",g.zLogin); |
| 560 | if( fossil_strcmp(zMimetype, "text/x-fossil-wiki")==0 ){ |
| 561 | zId = db_text(0, "SELECT lower(hex(randomblob(8)))"); |
| 562 | blob_appendf(p, "\n\n<hr><div id=\"%s\"><i>On %s UTC %h", |
| 563 | zId, zDate, g.zLogin); |
| 564 | if( zUser[0] && fossil_strcmp(zUser,g.zLogin) ){ |
| 565 | blob_appendf(p, " (claiming to be %h)", zUser); |
| 566 | } |
| 567 | blob_appendf(p, " added:</i><br />\n%s</div id=\"%s\">", zRemark, zId); |
| @@ -601,11 +601,11 @@ | |
| 601 | zMimetype = wiki_filter_mimetypes(P("mimetype")); |
| 602 | if( check_name(zPageName) ) return; |
| 603 | isSandbox = is_sandbox(zPageName); |
| 604 | if( !isSandbox ){ |
| 605 | zTag = mprintf("wiki-%s", zPageName); |
| 606 | rid = db_int(0, |
| 607 | "SELECT rid FROM tagxref" |
| 608 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 609 | " ORDER BY mtime DESC", zTag |
| 610 | ); |
| 611 | free(zTag); |
| @@ -690,11 +690,11 @@ | |
| 690 | @ <input type="hidden" name="mimetype" value="%h(zMimetype)" /> |
| 691 | @ Your Name: |
| 692 | @ <input type="text" name="u" size="20" value="%h(zUser)" /><br /> |
| 693 | zFormat = mimetype_common_name(zMimetype); |
| 694 | @ Comment to append (formatted as %s(zFormat)):<br /> |
| 695 | @ <textarea name="r" class="wikiedit" cols="80" |
| 696 | @ rows="10" wrap="virtual">%h(PD("r",""))</textarea> |
| 697 | @ <br /> |
| 698 | @ <input type="submit" name="preview" value="Preview Your Comment" /> |
| 699 | @ <input type="submit" name="submit" value="Append Your Changes" /> |
| 700 | @ <input type="submit" name="cancel" value="Cancel" /> |
| @@ -809,11 +809,11 @@ | |
| 809 | ** - tagxref (whatever that really is!) |
| 810 | ** |
| 811 | ** Used by wcontent_page() and the JSON wiki code. |
| 812 | */ |
| 813 | void wiki_prepare_page_list( Stmt * pStmt ){ |
| 814 | db_prepare(pStmt, |
| 815 | "SELECT" |
| 816 | " substr(tagname, 6) as name," |
| 817 | " (SELECT value FROM tagxref WHERE tagid=tag.tagid ORDER BY mtime DESC) as tagXref" |
| 818 | " FROM tag WHERE tagname GLOB 'wiki-*'" |
| 819 | " ORDER BY lower(tagname) /*sort*/" |
| @@ -866,11 +866,11 @@ | |
| 866 | login_check_credentials(); |
| 867 | if( !g.perm.RdWiki ){ login_needed(); return; } |
| 868 | zTitle = PD("title","*"); |
| 869 | style_header("Wiki Pages Found"); |
| 870 | @ <ul> |
| 871 | db_prepare(&q, |
| 872 | "SELECT substr(tagname, 6, 1000) FROM tag WHERE tagname like 'wiki-%%%q%%'" |
| 873 | " ORDER BY lower(tagname) /*sort*/" , |
| 874 | zTitle); |
| 875 | while( db_step(&q)==SQLITE_ROW ){ |
| 876 | const char *zName = db_column_text(&q, 0); |
| @@ -917,11 +917,11 @@ | |
| 917 | @ surrounded on both sides by two or more spaces or by a tab. Only a single |
| 918 | @ level of enumeration list is supported by wiki. For nested lists or for |
| 919 | @ enumerations that count using letters or roman numerials, use HTML.</p></li> |
| 920 | @ <li> <p><span class="wikiruleHead">Indented Paragraphs</span>. |
| 921 | @ Any paragraph that begins with two or more spaces or a tab and |
| 922 | @ which is not a bullet or enumeration list item is rendered |
| 923 | @ indented. Only a single level of indentation is supported by wiki; use |
| 924 | @ HTML for deeper indentation.</p></li> |
| 925 | @ <li> <p><span class="wikiruleHead">Hyperlinks</span>. |
| 926 | @ Text within square brackets ("[...]") becomes a hyperlink. The |
| 927 | @ target can be a wiki page name, the artifact ID of a check-in or ticket, |
| @@ -1062,11 +1062,11 @@ | |
| 1062 | } |
| 1063 | zPageName = g.argv[3]; |
| 1064 | rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x" |
| 1065 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'" |
| 1066 | " ORDER BY x.mtime DESC LIMIT 1", |
| 1067 | zPageName |
| 1068 | ); |
| 1069 | if( (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0 ){ |
| 1070 | zBody = pWiki->zWiki; |
| 1071 | } |
| 1072 | if( zBody==0 ){ |
| @@ -1110,11 +1110,11 @@ | |
| 1110 | } |
| 1111 | fossil_fatal("delete not yet implemented."); |
| 1112 | }else |
| 1113 | if( strncmp(g.argv[2],"list",n)==0 ){ |
| 1114 | Stmt q; |
| 1115 | db_prepare(&q, |
| 1116 | "SELECT substr(tagname, 6) FROM tag WHERE tagname GLOB 'wiki-*'" |
| 1117 | " ORDER BY lower(tagname) /*sort*/" |
| 1118 | ); |
| 1119 | while( db_step(&q)==SQLITE_ROW ){ |
| 1120 | const char *zName = db_column_text(&q, 0); |
| 1121 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -222,11 +222,11 @@ | |
| 222 | zBody = db_get("sandbox",zBody); |
| 223 | zMimetype = db_get("sandbox-mimetype","text/x-fossil-wiki"); |
| 224 | rid = 0; |
| 225 | }else{ |
| 226 | zTag = mprintf("wiki-%s", zPageName); |
| 227 | rid = db_int(0, |
| 228 | "SELECT rid FROM tagxref" |
| 229 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 230 | " ORDER BY mtime DESC", zTag |
| 231 | ); |
| 232 | free(zTag); |
| @@ -260,11 +260,11 @@ | |
| 260 | style_submenu_element("Attach", "Add An Attachment", |
| 261 | "%s/attachadd?page=%T&from=%s/wiki%%3fname=%T", |
| 262 | g.zTop, zPageName, g.zTop, zPageName); |
| 263 | } |
| 264 | if( rid && g.perm.ApndWiki ){ |
| 265 | style_submenu_element("Append", "Add A Comment", |
| 266 | "%s/wikiappend?name=%T&mimetype=%s", |
| 267 | g.zTop, zPageName, zMimetype); |
| 268 | } |
| 269 | if( g.perm.Hyperlink ){ |
| 270 | style_submenu_element("History", "History", "%s/whistory?name=%T", |
| @@ -381,11 +381,11 @@ | |
| 381 | zBody = db_get("sandbox",""); |
| 382 | zMimetype = db_get("sandbox-mimetype","text/x-fossil-wiki"); |
| 383 | } |
| 384 | }else{ |
| 385 | zTag = mprintf("wiki-%s", zPageName); |
| 386 | rid = db_int(0, |
| 387 | "SELECT rid FROM tagxref" |
| 388 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 389 | " ORDER BY mtime DESC", zTag |
| 390 | ); |
| 391 | free(zTag); |
| @@ -462,11 +462,11 @@ | |
| 462 | if( !isWysiwyg ){ |
| 463 | /* Traditional markup-only editing */ |
| 464 | form_begin(0, "%R/wikiedit"); |
| 465 | @ <div> |
| 466 | mimetype_option_menu(zMimetype); |
| 467 | @ <br /><textarea name="w" class="wikiedit" cols="80" |
| 468 | @ rows="%d(n)" wrap="virtual">%h(zBody)</textarea> |
| 469 | @ <br /> |
| 470 | if( db_get_boolean("wysiwyg-wiki", 0) ){ |
| 471 | @ <input type="submit" name="edit-wysiwyg" value="Wysiwyg Editor" |
| 472 | @ onclick='return confirm("Switching to WYSIWYG-mode\nwill erase your markup\nedits. Continue?")' /> |
| @@ -514,11 +514,11 @@ | |
| 514 | const char *zMimetype; |
| 515 | login_check_credentials(); |
| 516 | if( !g.perm.NewWiki ){ |
| 517 | login_needed(); |
| 518 | return; |
| 519 | } |
| 520 | zName = PD("name",""); |
| 521 | zMimetype = wiki_filter_mimetypes(P("mimetype")); |
| 522 | if( zName[0] && wiki_name_is_wellformed((const unsigned char *)zName) ){ |
| 523 | if( fossil_strcmp(zMimetype,"text/x-fossil-wiki")==0 |
| 524 | && db_get_boolean("wysiwyg-wiki", 0) |
| @@ -557,11 +557,11 @@ | |
| 557 | zDate = db_text(0, "SELECT datetime('now')"); |
| 558 | zRemark = PD("r",""); |
| 559 | zUser = PD("u",g.zLogin); |
| 560 | if( fossil_strcmp(zMimetype, "text/x-fossil-wiki")==0 ){ |
| 561 | zId = db_text(0, "SELECT lower(hex(randomblob(8)))"); |
| 562 | blob_appendf(p, "\n\n<hr><div id=\"%s\"><i>On %s UTC %h", |
| 563 | zId, zDate, g.zLogin); |
| 564 | if( zUser[0] && fossil_strcmp(zUser,g.zLogin) ){ |
| 565 | blob_appendf(p, " (claiming to be %h)", zUser); |
| 566 | } |
| 567 | blob_appendf(p, " added:</i><br />\n%s</div id=\"%s\">", zRemark, zId); |
| @@ -601,11 +601,11 @@ | |
| 601 | zMimetype = wiki_filter_mimetypes(P("mimetype")); |
| 602 | if( check_name(zPageName) ) return; |
| 603 | isSandbox = is_sandbox(zPageName); |
| 604 | if( !isSandbox ){ |
| 605 | zTag = mprintf("wiki-%s", zPageName); |
| 606 | rid = db_int(0, |
| 607 | "SELECT rid FROM tagxref" |
| 608 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname=%Q)" |
| 609 | " ORDER BY mtime DESC", zTag |
| 610 | ); |
| 611 | free(zTag); |
| @@ -690,11 +690,11 @@ | |
| 690 | @ <input type="hidden" name="mimetype" value="%h(zMimetype)" /> |
| 691 | @ Your Name: |
| 692 | @ <input type="text" name="u" size="20" value="%h(zUser)" /><br /> |
| 693 | zFormat = mimetype_common_name(zMimetype); |
| 694 | @ Comment to append (formatted as %s(zFormat)):<br /> |
| 695 | @ <textarea name="r" class="wikiedit" cols="80" |
| 696 | @ rows="10" wrap="virtual">%h(PD("r",""))</textarea> |
| 697 | @ <br /> |
| 698 | @ <input type="submit" name="preview" value="Preview Your Comment" /> |
| 699 | @ <input type="submit" name="submit" value="Append Your Changes" /> |
| 700 | @ <input type="submit" name="cancel" value="Cancel" /> |
| @@ -809,11 +809,11 @@ | |
| 809 | ** - tagxref (whatever that really is!) |
| 810 | ** |
| 811 | ** Used by wcontent_page() and the JSON wiki code. |
| 812 | */ |
| 813 | void wiki_prepare_page_list( Stmt * pStmt ){ |
| 814 | db_prepare(pStmt, |
| 815 | "SELECT" |
| 816 | " substr(tagname, 6) as name," |
| 817 | " (SELECT value FROM tagxref WHERE tagid=tag.tagid ORDER BY mtime DESC) as tagXref" |
| 818 | " FROM tag WHERE tagname GLOB 'wiki-*'" |
| 819 | " ORDER BY lower(tagname) /*sort*/" |
| @@ -866,11 +866,11 @@ | |
| 866 | login_check_credentials(); |
| 867 | if( !g.perm.RdWiki ){ login_needed(); return; } |
| 868 | zTitle = PD("title","*"); |
| 869 | style_header("Wiki Pages Found"); |
| 870 | @ <ul> |
| 871 | db_prepare(&q, |
| 872 | "SELECT substr(tagname, 6, 1000) FROM tag WHERE tagname like 'wiki-%%%q%%'" |
| 873 | " ORDER BY lower(tagname) /*sort*/" , |
| 874 | zTitle); |
| 875 | while( db_step(&q)==SQLITE_ROW ){ |
| 876 | const char *zName = db_column_text(&q, 0); |
| @@ -917,11 +917,11 @@ | |
| 917 | @ surrounded on both sides by two or more spaces or by a tab. Only a single |
| 918 | @ level of enumeration list is supported by wiki. For nested lists or for |
| 919 | @ enumerations that count using letters or roman numerials, use HTML.</p></li> |
| 920 | @ <li> <p><span class="wikiruleHead">Indented Paragraphs</span>. |
| 921 | @ Any paragraph that begins with two or more spaces or a tab and |
| 922 | @ which is not a bullet or enumeration list item is rendered |
| 923 | @ indented. Only a single level of indentation is supported by wiki; use |
| 924 | @ HTML for deeper indentation.</p></li> |
| 925 | @ <li> <p><span class="wikiruleHead">Hyperlinks</span>. |
| 926 | @ Text within square brackets ("[...]") becomes a hyperlink. The |
| 927 | @ target can be a wiki page name, the artifact ID of a check-in or ticket, |
| @@ -1062,11 +1062,11 @@ | |
| 1062 | } |
| 1063 | zPageName = g.argv[3]; |
| 1064 | rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x" |
| 1065 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'" |
| 1066 | " ORDER BY x.mtime DESC LIMIT 1", |
| 1067 | zPageName |
| 1068 | ); |
| 1069 | if( (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0 ){ |
| 1070 | zBody = pWiki->zWiki; |
| 1071 | } |
| 1072 | if( zBody==0 ){ |
| @@ -1110,11 +1110,11 @@ | |
| 1110 | } |
| 1111 | fossil_fatal("delete not yet implemented."); |
| 1112 | }else |
| 1113 | if( strncmp(g.argv[2],"list",n)==0 ){ |
| 1114 | Stmt q; |
| 1115 | db_prepare(&q, |
| 1116 | "SELECT substr(tagname, 6) FROM tag WHERE tagname GLOB 'wiki-*'" |
| 1117 | " ORDER BY lower(tagname) /*sort*/" |
| 1118 | ); |
| 1119 | while( db_step(&q)==SQLITE_ROW ){ |
| 1120 | const char *zName = db_column_text(&q, 0); |
| 1121 |
+7
-7
| --- src/wysiwyg.c | ||
| +++ src/wysiwyg.c | ||
| @@ -228,18 +228,18 @@ | ||
| 228 | 228 | @ <div id="wysiwygBox" |
| 229 | 229 | @ style="resize:both; overflow:auto; width: %d(w)em; height: %d(h)em;" |
| 230 | 230 | @ contenteditable="true">%s(zContent)</div> |
| 231 | 231 | @ <script> |
| 232 | 232 | @ var oDoc; |
| 233 | - @ | |
| 233 | + @ | |
| 234 | 234 | @ /* Initialize the document editor */ |
| 235 | 235 | @ function initDoc() { |
| 236 | 236 | @ oDoc = document.getElementById("wysiwygBox"); |
| 237 | 237 | @ if (!isWysiwyg()) { setDocMode(true); } |
| 238 | 238 | @ } |
| 239 | - @ | |
| 240 | - @ /* Return true if the document editor is in WYSIWYG mode. Return | |
| 239 | + @ | |
| 240 | + @ /* Return true if the document editor is in WYSIWYG mode. Return | |
| 241 | 241 | @ ** false if it is in Markup mode */ |
| 242 | 242 | @ function isWysiwyg() { |
| 243 | 243 | @ return document.getElementById("editMode").selectedIndex==0; |
| 244 | 244 | @ } |
| 245 | 245 | @ |
| @@ -247,22 +247,22 @@ | ||
| 247 | 247 | @ ** to the server */ |
| 248 | 248 | @ function wysiwygSubmit() { |
| 249 | 249 | @ if(oDoc.style.whiteSpace=="pre-wrap"){setDocMode(0);} |
| 250 | 250 | @ document.getElementById("wysiwygValue").value=oDoc.innerHTML; |
| 251 | 251 | @ } |
| 252 | - @ | |
| 253 | - @ /* Run the editing command if in WYSIWYG mode */ | |
| 252 | + @ | |
| 253 | + @ /* Run the editing command if in WYSIWYG mode */ | |
| 254 | 254 | @ function formatDoc(sCmd, sValue) { |
| 255 | 255 | @ if (isWysiwyg()){ |
| 256 | 256 | @ document.execCommand("styleWithCSS", false, false); |
| 257 | 257 | @ document.execCommand(sCmd, false, sValue); |
| 258 | 258 | @ oDoc.focus(); |
| 259 | 259 | @ } |
| 260 | 260 | @ } |
| 261 | - @ | |
| 261 | + @ | |
| 262 | 262 | @ /* Change the editing mode. Convert to markup if the argument |
| 263 | - @ ** is true and wysiwyg if the argument is false. */ | |
| 263 | + @ ** is true and wysiwyg if the argument is false. */ | |
| 264 | 264 | @ function setDocMode(bToMarkup) { |
| 265 | 265 | @ var oContent; |
| 266 | 266 | @ if (bToMarkup) { |
| 267 | 267 | @ /* WYSIWYG -> Markup */ |
| 268 | 268 | @ var linebreak = new RegExp("</p><p>","ig"); |
| 269 | 269 |
| --- src/wysiwyg.c | |
| +++ src/wysiwyg.c | |
| @@ -228,18 +228,18 @@ | |
| 228 | @ <div id="wysiwygBox" |
| 229 | @ style="resize:both; overflow:auto; width: %d(w)em; height: %d(h)em;" |
| 230 | @ contenteditable="true">%s(zContent)</div> |
| 231 | @ <script> |
| 232 | @ var oDoc; |
| 233 | @ |
| 234 | @ /* Initialize the document editor */ |
| 235 | @ function initDoc() { |
| 236 | @ oDoc = document.getElementById("wysiwygBox"); |
| 237 | @ if (!isWysiwyg()) { setDocMode(true); } |
| 238 | @ } |
| 239 | @ |
| 240 | @ /* Return true if the document editor is in WYSIWYG mode. Return |
| 241 | @ ** false if it is in Markup mode */ |
| 242 | @ function isWysiwyg() { |
| 243 | @ return document.getElementById("editMode").selectedIndex==0; |
| 244 | @ } |
| 245 | @ |
| @@ -247,22 +247,22 @@ | |
| 247 | @ ** to the server */ |
| 248 | @ function wysiwygSubmit() { |
| 249 | @ if(oDoc.style.whiteSpace=="pre-wrap"){setDocMode(0);} |
| 250 | @ document.getElementById("wysiwygValue").value=oDoc.innerHTML; |
| 251 | @ } |
| 252 | @ |
| 253 | @ /* Run the editing command if in WYSIWYG mode */ |
| 254 | @ function formatDoc(sCmd, sValue) { |
| 255 | @ if (isWysiwyg()){ |
| 256 | @ document.execCommand("styleWithCSS", false, false); |
| 257 | @ document.execCommand(sCmd, false, sValue); |
| 258 | @ oDoc.focus(); |
| 259 | @ } |
| 260 | @ } |
| 261 | @ |
| 262 | @ /* Change the editing mode. Convert to markup if the argument |
| 263 | @ ** is true and wysiwyg if the argument is false. */ |
| 264 | @ function setDocMode(bToMarkup) { |
| 265 | @ var oContent; |
| 266 | @ if (bToMarkup) { |
| 267 | @ /* WYSIWYG -> Markup */ |
| 268 | @ var linebreak = new RegExp("</p><p>","ig"); |
| 269 |
| --- src/wysiwyg.c | |
| +++ src/wysiwyg.c | |
| @@ -228,18 +228,18 @@ | |
| 228 | @ <div id="wysiwygBox" |
| 229 | @ style="resize:both; overflow:auto; width: %d(w)em; height: %d(h)em;" |
| 230 | @ contenteditable="true">%s(zContent)</div> |
| 231 | @ <script> |
| 232 | @ var oDoc; |
| 233 | @ |
| 234 | @ /* Initialize the document editor */ |
| 235 | @ function initDoc() { |
| 236 | @ oDoc = document.getElementById("wysiwygBox"); |
| 237 | @ if (!isWysiwyg()) { setDocMode(true); } |
| 238 | @ } |
| 239 | @ |
| 240 | @ /* Return true if the document editor is in WYSIWYG mode. Return |
| 241 | @ ** false if it is in Markup mode */ |
| 242 | @ function isWysiwyg() { |
| 243 | @ return document.getElementById("editMode").selectedIndex==0; |
| 244 | @ } |
| 245 | @ |
| @@ -247,22 +247,22 @@ | |
| 247 | @ ** to the server */ |
| 248 | @ function wysiwygSubmit() { |
| 249 | @ if(oDoc.style.whiteSpace=="pre-wrap"){setDocMode(0);} |
| 250 | @ document.getElementById("wysiwygValue").value=oDoc.innerHTML; |
| 251 | @ } |
| 252 | @ |
| 253 | @ /* Run the editing command if in WYSIWYG mode */ |
| 254 | @ function formatDoc(sCmd, sValue) { |
| 255 | @ if (isWysiwyg()){ |
| 256 | @ document.execCommand("styleWithCSS", false, false); |
| 257 | @ document.execCommand(sCmd, false, sValue); |
| 258 | @ oDoc.focus(); |
| 259 | @ } |
| 260 | @ } |
| 261 | @ |
| 262 | @ /* Change the editing mode. Convert to markup if the argument |
| 263 | @ ** is true and wysiwyg if the argument is false. */ |
| 264 | @ function setDocMode(bToMarkup) { |
| 265 | @ var oContent; |
| 266 | @ if (bToMarkup) { |
| 267 | @ /* WYSIWYG -> Markup */ |
| 268 | @ var linebreak = new RegExp("</p><p>","ig"); |
| 269 |
+5
-5
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -158,17 +158,17 @@ | ||
| 158 | 158 | put16(&zHdr[8], iMethod); |
| 159 | 159 | put16(&zHdr[10], dosTime); |
| 160 | 160 | put16(&zHdr[12], dosDate); |
| 161 | 161 | put16(&zHdr[26], nameLen); |
| 162 | 162 | put16(&zHdr[28], 13); |
| 163 | - | |
| 163 | + | |
| 164 | 164 | put16(&zExTime[0], 0x5455); |
| 165 | 165 | put16(&zExTime[2], 9); |
| 166 | 166 | zExTime[4] = 3; |
| 167 | 167 | put32(&zExTime[5], unixTime); |
| 168 | 168 | put32(&zExTime[9], unixTime); |
| 169 | - | |
| 169 | + | |
| 170 | 170 | |
| 171 | 171 | /* Write the header and filename. |
| 172 | 172 | */ |
| 173 | 173 | iStart = blob_size(&body); |
| 174 | 174 | blob_append(&body, zHdr, 30); |
| @@ -202,19 +202,19 @@ | ||
| 202 | 202 | blob_append(&body, zOutBuf, toOut); |
| 203 | 203 | }while( stream.avail_out==0 ); |
| 204 | 204 | nByte = stream.total_in; |
| 205 | 205 | nByteCompr = stream.total_out; |
| 206 | 206 | deflateEnd(&stream); |
| 207 | - | |
| 207 | + | |
| 208 | 208 | /* Go back and write the header, now that we know the compressed file size. |
| 209 | 209 | */ |
| 210 | 210 | z = &blob_buffer(&body)[iStart]; |
| 211 | 211 | put32(&z[14], iCRC); |
| 212 | 212 | put32(&z[18], nByteCompr); |
| 213 | 213 | put32(&z[22], nByte); |
| 214 | 214 | } |
| 215 | - | |
| 215 | + | |
| 216 | 216 | /* Make an entry in the tables of contents |
| 217 | 217 | */ |
| 218 | 218 | memset(zBuf, 0, sizeof(zBuf)); |
| 219 | 219 | put32(&zBuf[0], 0x02014b50); |
| 220 | 220 | put16(&zBuf[4], 0x0317); |
| @@ -322,11 +322,11 @@ | ||
| 322 | 322 | Blob mfile, hash, file; |
| 323 | 323 | Manifest *pManifest; |
| 324 | 324 | ManifestFile *pFile; |
| 325 | 325 | Blob filename; |
| 326 | 326 | int nPrefix; |
| 327 | - | |
| 327 | + | |
| 328 | 328 | content_get(rid, &mfile); |
| 329 | 329 | if( blob_size(&mfile)==0 ){ |
| 330 | 330 | blob_zero(pZip); |
| 331 | 331 | return; |
| 332 | 332 | } |
| 333 | 333 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -158,17 +158,17 @@ | |
| 158 | put16(&zHdr[8], iMethod); |
| 159 | put16(&zHdr[10], dosTime); |
| 160 | put16(&zHdr[12], dosDate); |
| 161 | put16(&zHdr[26], nameLen); |
| 162 | put16(&zHdr[28], 13); |
| 163 | |
| 164 | put16(&zExTime[0], 0x5455); |
| 165 | put16(&zExTime[2], 9); |
| 166 | zExTime[4] = 3; |
| 167 | put32(&zExTime[5], unixTime); |
| 168 | put32(&zExTime[9], unixTime); |
| 169 | |
| 170 | |
| 171 | /* Write the header and filename. |
| 172 | */ |
| 173 | iStart = blob_size(&body); |
| 174 | blob_append(&body, zHdr, 30); |
| @@ -202,19 +202,19 @@ | |
| 202 | blob_append(&body, zOutBuf, toOut); |
| 203 | }while( stream.avail_out==0 ); |
| 204 | nByte = stream.total_in; |
| 205 | nByteCompr = stream.total_out; |
| 206 | deflateEnd(&stream); |
| 207 | |
| 208 | /* Go back and write the header, now that we know the compressed file size. |
| 209 | */ |
| 210 | z = &blob_buffer(&body)[iStart]; |
| 211 | put32(&z[14], iCRC); |
| 212 | put32(&z[18], nByteCompr); |
| 213 | put32(&z[22], nByte); |
| 214 | } |
| 215 | |
| 216 | /* Make an entry in the tables of contents |
| 217 | */ |
| 218 | memset(zBuf, 0, sizeof(zBuf)); |
| 219 | put32(&zBuf[0], 0x02014b50); |
| 220 | put16(&zBuf[4], 0x0317); |
| @@ -322,11 +322,11 @@ | |
| 322 | Blob mfile, hash, file; |
| 323 | Manifest *pManifest; |
| 324 | ManifestFile *pFile; |
| 325 | Blob filename; |
| 326 | int nPrefix; |
| 327 | |
| 328 | content_get(rid, &mfile); |
| 329 | if( blob_size(&mfile)==0 ){ |
| 330 | blob_zero(pZip); |
| 331 | return; |
| 332 | } |
| 333 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -158,17 +158,17 @@ | |
| 158 | put16(&zHdr[8], iMethod); |
| 159 | put16(&zHdr[10], dosTime); |
| 160 | put16(&zHdr[12], dosDate); |
| 161 | put16(&zHdr[26], nameLen); |
| 162 | put16(&zHdr[28], 13); |
| 163 | |
| 164 | put16(&zExTime[0], 0x5455); |
| 165 | put16(&zExTime[2], 9); |
| 166 | zExTime[4] = 3; |
| 167 | put32(&zExTime[5], unixTime); |
| 168 | put32(&zExTime[9], unixTime); |
| 169 | |
| 170 | |
| 171 | /* Write the header and filename. |
| 172 | */ |
| 173 | iStart = blob_size(&body); |
| 174 | blob_append(&body, zHdr, 30); |
| @@ -202,19 +202,19 @@ | |
| 202 | blob_append(&body, zOutBuf, toOut); |
| 203 | }while( stream.avail_out==0 ); |
| 204 | nByte = stream.total_in; |
| 205 | nByteCompr = stream.total_out; |
| 206 | deflateEnd(&stream); |
| 207 | |
| 208 | /* Go back and write the header, now that we know the compressed file size. |
| 209 | */ |
| 210 | z = &blob_buffer(&body)[iStart]; |
| 211 | put32(&z[14], iCRC); |
| 212 | put32(&z[18], nByteCompr); |
| 213 | put32(&z[22], nByte); |
| 214 | } |
| 215 | |
| 216 | /* Make an entry in the tables of contents |
| 217 | */ |
| 218 | memset(zBuf, 0, sizeof(zBuf)); |
| 219 | put32(&zBuf[0], 0x02014b50); |
| 220 | put16(&zBuf[4], 0x0317); |
| @@ -322,11 +322,11 @@ | |
| 322 | Blob mfile, hash, file; |
| 323 | Manifest *pManifest; |
| 324 | ManifestFile *pFile; |
| 325 | Blob filename; |
| 326 | int nPrefix; |
| 327 | |
| 328 | content_get(rid, &mfile); |
| 329 | if( blob_size(&mfile)==0 ){ |
| 330 | blob_zero(pZip); |
| 331 | return; |
| 332 | } |
| 333 |