Skip to content

Commit

Permalink
Fix for issue #105: not initialized variable gorilla::fileName
Browse files Browse the repository at this point in the history
  • Loading branch information
zdia committed Feb 13, 2013
1 parent 189e071 commit 203b4a3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions sources/gorilla.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -4540,7 +4540,8 @@ proc gorilla::SaveAs {} {
set ::gorilla::status [mc "Password database saved."]

return GORILLA_OK
}

} ; # end proc gorilla::SaveAs

proc gorilla::filename_query {type args} {

Expand Down Expand Up @@ -4976,9 +4977,17 @@ proc gorilla::LockDatabase {} {
rename ::tk::mac::ShowPreferences ""
}

# FIXME: perhaps it's better to backup the db in any case?
if { $::gorilla::preference(keepBackupFile) } {
set message [ gorilla::SaveBackup $::gorilla::fileName ]

if { ![info exists ::gorilla::fileName] } {
set nosave [tk_dialog .nosave [mc "Database not saved!"] \
[mc "This database has not been saved. Do you want to save it now?"] \
"" 0 [mc Yes] [mc No] ]
if {$nosave} { set message GORILLA_OK
} else { set message [gorilla::SaveAs] }

} else { set message [ gorilla::SaveBackup $::gorilla::fileName ] }

if { $message ne "GORILLA_OK" } {
gorilla::ErrorPopup [lindex $message 0] [lindex $message 1]
}
Expand Down

0 comments on commit 203b4a3

Please sign in to comment.