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>

jan.nijtmans 2012-10-26 12:28 trunk
Commit 10e0d0b256a0f8b58e321d6c76b28399a4f8d53a
1 file changed +7 -7
+7 -7
--- src/stash.c
+++ src/stash.c
@@ -22,11 +22,11 @@
2222
2323
2424
/*
2525
** SQL code to implement the tables needed by the stash.
2626
*/
27
-static const char zStashInit[] =
27
+static const char zStashInit[] =
2828
@ CREATE TABLE IF NOT EXISTS %s.stash(
2929
@ stashid INTEGER PRIMARY KEY, -- Unique stash identifier
3030
@ vid INTEGER, -- The baseline check-out for this stash
3131
@ comment TEXT, -- Comment for this stash. Or NULL
3232
@ ctime TIMESTAMP -- When the stash was created
@@ -114,11 +114,11 @@
114114
db_bind_null(&ins, ":content");
115115
}else{
116116
/* A modified file */
117117
Blob orig;
118118
Blob disk;
119
-
119
+
120120
if( isNewLink ){
121121
blob_read_link(&disk, zPath);
122122
}else{
123123
blob_read_from_file(&disk, zPath);
124124
}
@@ -242,11 +242,11 @@
242242
file_delete(zNPath);
243243
}
244244
if( isLink ){
245245
symlink_create(blob_str(&b), zNPath);
246246
}else{
247
- blob_write_to_file(&b, zNPath);
247
+ blob_write_to_file(&b, zNPath);
248248
}
249249
file_wd_setexe(zNPath, isExec);
250250
fossil_print("UPDATE %s\n", zNew);
251251
}else{
252252
int rc;
@@ -254,11 +254,11 @@
254254
rc = -1;
255255
blob_zero(&b); /* because we reset it later */
256256
fossil_print("***** Cannot merge symlink %s\n", zNew);
257257
}else{
258258
rc = merge_3way(&a, zOPath, &b, &out);
259
- blob_write_to_file(&out, zNPath);
259
+ blob_write_to_file(&out, zNPath);
260260
blob_reset(&out);
261261
file_wd_setexe(zNPath, isExec);
262262
}
263263
if( rc ){
264264
fossil_print("CONFLICT %s\n", zNew);
@@ -342,11 +342,11 @@
342342
db_ephemeral_blob(&q, 6, &delta);
343343
if( fBaseline==0 ){
344344
if( isOrigLink ){
345345
blob_read_link(&disk, zOPath);
346346
}else{
347
- blob_read_from_file(&disk, zOPath);
347
+ blob_read_from_file(&disk, zOPath);
348348
}
349349
}
350350
fossil_print("CHANGED %s\n", zNew);
351351
if( !isOrigLink != !isLink ){
352352
diff_print_index(zNew, diffFlags);
@@ -449,11 +449,11 @@
449449
**
450450
** fossil stash diff ?STASHID?
451451
** fossil stash gdiff ?STASHID?
452452
**
453453
** 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.
455455
**
456456
** SUMMARY:
457457
** fossil stash
458458
** fossil stash save ?-m COMMENT? ?FILES...?
459459
** fossil stash snapshot ?-m COMMENT? ?FILES...?
@@ -467,11 +467,11 @@
467467
*/
468468
void stash_cmd(void){
469469
const char *zDb;
470470
const char *zCmd;
471471
int nCmd;
472
- int stashid;
472
+ int stashid = 0;
473473
474474
undo_capture_command_line();
475475
db_must_be_within_tree();
476476
db_open_config(0);
477477
db_begin_transaction();
478478
--- 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

Keyboard Shortcuts

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