Fossil SCM
<pre>src/stash.c: In function ‘stash_cmd’: src/stash.c:377:16: warning: ‘stashid’ may be used uninitialized in this function src/stash.c:472:7: note: ‘stashid’ was declared here</pre>
Commit
10e0d0b256a0f8b58e321d6c76b28399a4f8d53a
Parent
511405f4268502e…
1 file changed
+7
-7
+7
-7
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -22,11 +22,11 @@ | ||
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | /* |
| 25 | 25 | ** SQL code to implement the tables needed by the stash. |
| 26 | 26 | */ |
| 27 | -static const char zStashInit[] = | |
| 27 | +static const char zStashInit[] = | |
| 28 | 28 | @ CREATE TABLE IF NOT EXISTS %s.stash( |
| 29 | 29 | @ stashid INTEGER PRIMARY KEY, -- Unique stash identifier |
| 30 | 30 | @ vid INTEGER, -- The baseline check-out for this stash |
| 31 | 31 | @ comment TEXT, -- Comment for this stash. Or NULL |
| 32 | 32 | @ ctime TIMESTAMP -- When the stash was created |
| @@ -114,11 +114,11 @@ | ||
| 114 | 114 | db_bind_null(&ins, ":content"); |
| 115 | 115 | }else{ |
| 116 | 116 | /* A modified file */ |
| 117 | 117 | Blob orig; |
| 118 | 118 | Blob disk; |
| 119 | - | |
| 119 | + | |
| 120 | 120 | if( isNewLink ){ |
| 121 | 121 | blob_read_link(&disk, zPath); |
| 122 | 122 | }else{ |
| 123 | 123 | blob_read_from_file(&disk, zPath); |
| 124 | 124 | } |
| @@ -242,11 +242,11 @@ | ||
| 242 | 242 | file_delete(zNPath); |
| 243 | 243 | } |
| 244 | 244 | if( isLink ){ |
| 245 | 245 | symlink_create(blob_str(&b), zNPath); |
| 246 | 246 | }else{ |
| 247 | - blob_write_to_file(&b, zNPath); | |
| 247 | + blob_write_to_file(&b, zNPath); | |
| 248 | 248 | } |
| 249 | 249 | file_wd_setexe(zNPath, isExec); |
| 250 | 250 | fossil_print("UPDATE %s\n", zNew); |
| 251 | 251 | }else{ |
| 252 | 252 | int rc; |
| @@ -254,11 +254,11 @@ | ||
| 254 | 254 | rc = -1; |
| 255 | 255 | blob_zero(&b); /* because we reset it later */ |
| 256 | 256 | fossil_print("***** Cannot merge symlink %s\n", zNew); |
| 257 | 257 | }else{ |
| 258 | 258 | rc = merge_3way(&a, zOPath, &b, &out); |
| 259 | - blob_write_to_file(&out, zNPath); | |
| 259 | + blob_write_to_file(&out, zNPath); | |
| 260 | 260 | blob_reset(&out); |
| 261 | 261 | file_wd_setexe(zNPath, isExec); |
| 262 | 262 | } |
| 263 | 263 | if( rc ){ |
| 264 | 264 | fossil_print("CONFLICT %s\n", zNew); |
| @@ -342,11 +342,11 @@ | ||
| 342 | 342 | db_ephemeral_blob(&q, 6, &delta); |
| 343 | 343 | if( fBaseline==0 ){ |
| 344 | 344 | if( isOrigLink ){ |
| 345 | 345 | blob_read_link(&disk, zOPath); |
| 346 | 346 | }else{ |
| 347 | - blob_read_from_file(&disk, zOPath); | |
| 347 | + blob_read_from_file(&disk, zOPath); | |
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | fossil_print("CHANGED %s\n", zNew); |
| 351 | 351 | if( !isOrigLink != !isLink ){ |
| 352 | 352 | diff_print_index(zNew, diffFlags); |
| @@ -449,11 +449,11 @@ | ||
| 449 | 449 | ** |
| 450 | 450 | ** fossil stash diff ?STASHID? |
| 451 | 451 | ** fossil stash gdiff ?STASHID? |
| 452 | 452 | ** |
| 453 | 453 | ** Show diffs of the current working directory and what that |
| 454 | -** directory would be if STASHID were applied. | |
| 454 | +** directory would be if STASHID were applied. | |
| 455 | 455 | ** |
| 456 | 456 | ** SUMMARY: |
| 457 | 457 | ** fossil stash |
| 458 | 458 | ** fossil stash save ?-m COMMENT? ?FILES...? |
| 459 | 459 | ** fossil stash snapshot ?-m COMMENT? ?FILES...? |
| @@ -467,11 +467,11 @@ | ||
| 467 | 467 | */ |
| 468 | 468 | void stash_cmd(void){ |
| 469 | 469 | const char *zDb; |
| 470 | 470 | const char *zCmd; |
| 471 | 471 | int nCmd; |
| 472 | - int stashid; | |
| 472 | + int stashid = 0; | |
| 473 | 473 | |
| 474 | 474 | undo_capture_command_line(); |
| 475 | 475 | db_must_be_within_tree(); |
| 476 | 476 | db_open_config(0); |
| 477 | 477 | db_begin_transaction(); |
| 478 | 478 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -22,11 +22,11 @@ | |
| 22 | |
| 23 | |
| 24 | /* |
| 25 | ** SQL code to implement the tables needed by the stash. |
| 26 | */ |
| 27 | static const char zStashInit[] = |
| 28 | @ CREATE TABLE IF NOT EXISTS %s.stash( |
| 29 | @ stashid INTEGER PRIMARY KEY, -- Unique stash identifier |
| 30 | @ vid INTEGER, -- The baseline check-out for this stash |
| 31 | @ comment TEXT, -- Comment for this stash. Or NULL |
| 32 | @ ctime TIMESTAMP -- When the stash was created |
| @@ -114,11 +114,11 @@ | |
| 114 | db_bind_null(&ins, ":content"); |
| 115 | }else{ |
| 116 | /* A modified file */ |
| 117 | Blob orig; |
| 118 | Blob disk; |
| 119 | |
| 120 | if( isNewLink ){ |
| 121 | blob_read_link(&disk, zPath); |
| 122 | }else{ |
| 123 | blob_read_from_file(&disk, zPath); |
| 124 | } |
| @@ -242,11 +242,11 @@ | |
| 242 | file_delete(zNPath); |
| 243 | } |
| 244 | if( isLink ){ |
| 245 | symlink_create(blob_str(&b), zNPath); |
| 246 | }else{ |
| 247 | blob_write_to_file(&b, zNPath); |
| 248 | } |
| 249 | file_wd_setexe(zNPath, isExec); |
| 250 | fossil_print("UPDATE %s\n", zNew); |
| 251 | }else{ |
| 252 | int rc; |
| @@ -254,11 +254,11 @@ | |
| 254 | rc = -1; |
| 255 | blob_zero(&b); /* because we reset it later */ |
| 256 | fossil_print("***** Cannot merge symlink %s\n", zNew); |
| 257 | }else{ |
| 258 | rc = merge_3way(&a, zOPath, &b, &out); |
| 259 | blob_write_to_file(&out, zNPath); |
| 260 | blob_reset(&out); |
| 261 | file_wd_setexe(zNPath, isExec); |
| 262 | } |
| 263 | if( rc ){ |
| 264 | fossil_print("CONFLICT %s\n", zNew); |
| @@ -342,11 +342,11 @@ | |
| 342 | db_ephemeral_blob(&q, 6, &delta); |
| 343 | if( fBaseline==0 ){ |
| 344 | if( isOrigLink ){ |
| 345 | blob_read_link(&disk, zOPath); |
| 346 | }else{ |
| 347 | blob_read_from_file(&disk, zOPath); |
| 348 | } |
| 349 | } |
| 350 | fossil_print("CHANGED %s\n", zNew); |
| 351 | if( !isOrigLink != !isLink ){ |
| 352 | diff_print_index(zNew, diffFlags); |
| @@ -449,11 +449,11 @@ | |
| 449 | ** |
| 450 | ** fossil stash diff ?STASHID? |
| 451 | ** fossil stash gdiff ?STASHID? |
| 452 | ** |
| 453 | ** Show diffs of the current working directory and what that |
| 454 | ** directory would be if STASHID were applied. |
| 455 | ** |
| 456 | ** SUMMARY: |
| 457 | ** fossil stash |
| 458 | ** fossil stash save ?-m COMMENT? ?FILES...? |
| 459 | ** fossil stash snapshot ?-m COMMENT? ?FILES...? |
| @@ -467,11 +467,11 @@ | |
| 467 | */ |
| 468 | void stash_cmd(void){ |
| 469 | const char *zDb; |
| 470 | const char *zCmd; |
| 471 | int nCmd; |
| 472 | int stashid; |
| 473 | |
| 474 | undo_capture_command_line(); |
| 475 | db_must_be_within_tree(); |
| 476 | db_open_config(0); |
| 477 | db_begin_transaction(); |
| 478 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -22,11 +22,11 @@ | |
| 22 | |
| 23 | |
| 24 | /* |
| 25 | ** SQL code to implement the tables needed by the stash. |
| 26 | */ |
| 27 | static const char zStashInit[] = |
| 28 | @ CREATE TABLE IF NOT EXISTS %s.stash( |
| 29 | @ stashid INTEGER PRIMARY KEY, -- Unique stash identifier |
| 30 | @ vid INTEGER, -- The baseline check-out for this stash |
| 31 | @ comment TEXT, -- Comment for this stash. Or NULL |
| 32 | @ ctime TIMESTAMP -- When the stash was created |
| @@ -114,11 +114,11 @@ | |
| 114 | db_bind_null(&ins, ":content"); |
| 115 | }else{ |
| 116 | /* A modified file */ |
| 117 | Blob orig; |
| 118 | Blob disk; |
| 119 | |
| 120 | if( isNewLink ){ |
| 121 | blob_read_link(&disk, zPath); |
| 122 | }else{ |
| 123 | blob_read_from_file(&disk, zPath); |
| 124 | } |
| @@ -242,11 +242,11 @@ | |
| 242 | file_delete(zNPath); |
| 243 | } |
| 244 | if( isLink ){ |
| 245 | symlink_create(blob_str(&b), zNPath); |
| 246 | }else{ |
| 247 | blob_write_to_file(&b, zNPath); |
| 248 | } |
| 249 | file_wd_setexe(zNPath, isExec); |
| 250 | fossil_print("UPDATE %s\n", zNew); |
| 251 | }else{ |
| 252 | int rc; |
| @@ -254,11 +254,11 @@ | |
| 254 | rc = -1; |
| 255 | blob_zero(&b); /* because we reset it later */ |
| 256 | fossil_print("***** Cannot merge symlink %s\n", zNew); |
| 257 | }else{ |
| 258 | rc = merge_3way(&a, zOPath, &b, &out); |
| 259 | blob_write_to_file(&out, zNPath); |
| 260 | blob_reset(&out); |
| 261 | file_wd_setexe(zNPath, isExec); |
| 262 | } |
| 263 | if( rc ){ |
| 264 | fossil_print("CONFLICT %s\n", zNew); |
| @@ -342,11 +342,11 @@ | |
| 342 | db_ephemeral_blob(&q, 6, &delta); |
| 343 | if( fBaseline==0 ){ |
| 344 | if( isOrigLink ){ |
| 345 | blob_read_link(&disk, zOPath); |
| 346 | }else{ |
| 347 | blob_read_from_file(&disk, zOPath); |
| 348 | } |
| 349 | } |
| 350 | fossil_print("CHANGED %s\n", zNew); |
| 351 | if( !isOrigLink != !isLink ){ |
| 352 | diff_print_index(zNew, diffFlags); |
| @@ -449,11 +449,11 @@ | |
| 449 | ** |
| 450 | ** fossil stash diff ?STASHID? |
| 451 | ** fossil stash gdiff ?STASHID? |
| 452 | ** |
| 453 | ** Show diffs of the current working directory and what that |
| 454 | ** directory would be if STASHID were applied. |
| 455 | ** |
| 456 | ** SUMMARY: |
| 457 | ** fossil stash |
| 458 | ** fossil stash save ?-m COMMENT? ?FILES...? |
| 459 | ** fossil stash snapshot ?-m COMMENT? ?FILES...? |
| @@ -467,11 +467,11 @@ | |
| 467 | */ |
| 468 | void stash_cmd(void){ |
| 469 | const char *zDb; |
| 470 | const char *zCmd; |
| 471 | int nCmd; |
| 472 | int stashid = 0; |
| 473 | |
| 474 | undo_capture_command_line(); |
| 475 | db_must_be_within_tree(); |
| 476 | db_open_config(0); |
| 477 | db_begin_transaction(); |
| 478 |