[specimen] PATCH: specimen wipes out your bank if you choose "new" and then "save"

Ken Restivo ken at restivo.org
Mon May 21 11:46:35 CDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I played a live show Saturday night. I tried to create a new bank on the fly, by choosing "New" and then "Save" in order to save the new bank somewhere, and it wiped out the existing bank I had previously loaded! My heart jumped all the way up into my sinuses. My backups and CVS repository were at home. Took about 15 minutes to re-create the bank while on-stage.

Fix is here:

- --- specimen-0.5.2.rc3.orig/src/gui/bank-ops.c
+++ specimen-0.5.2.rc3/src/gui/bank-ops.c
@@ -140,5 +140,6 @@
 int bank_ops_new ( )
 {
      patch_destroy_all ( );
+	 last_bank = strdup ("\0");
      return 0;
 }

The "proper" thing would probably be to gray out the Save button and then only enable it again once the first patch has been added. But I didn't feel like dealing with GTK's weird API for finding a handle to a widget by name. The above simple patch will at least prevent catastrophic data loss.

- -ken
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFGUczre8HF+6xeOIcRAuhVAKDQAtNhLNZiZbRsDW7I6zc+1aabRgCcCffB
7oootUFs6TVu2aX4D09zHjI=
=rqVA
-----END PGP SIGNATURE-----

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Specimen mailing list