diff options
Diffstat (limited to 'src/gmcerts.c')
-rw-r--r-- | src/gmcerts.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gmcerts.c b/src/gmcerts.c index 0a5638fa..da918279 100644 --- a/src/gmcerts.c +++ b/src/gmcerts.c | |||
@@ -34,9 +34,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
34 | #include <the_Foundation/time.h> | 34 | #include <the_Foundation/time.h> |
35 | #include <ctype.h> | 35 | #include <ctype.h> |
36 | 36 | ||
37 | static const char *filename_GmCerts_ = "trusted.txt"; | 37 | static const char *filename_GmCerts_ = "trusted.txt"; |
38 | static const char *identsDir_GmCerts_ = "idents"; | 38 | static const char *identsDir_GmCerts_ = "idents"; |
39 | static const char *identsFilename_GmCerts_ = "idents.binary"; | 39 | static const char *oldIdentsFilename_GmCerts_ = "idents.binary"; |
40 | static const char *identsFilename_GmCerts_ = "idents.lgr"; | ||
40 | 41 | ||
41 | iDeclareClass(TrustEntry) | 42 | iDeclareClass(TrustEntry) |
42 | 43 | ||
@@ -237,8 +238,9 @@ static void save_GmCerts_(const iGmCerts *d) { | |||
237 | } | 238 | } |
238 | 239 | ||
239 | static void loadIdentities_GmCerts_(iGmCerts *d) { | 240 | static void loadIdentities_GmCerts_(iGmCerts *d) { |
240 | iFile *f = | 241 | const iString *oldPath = collect_String(concatCStr_Path(&d->saveDir, oldIdentsFilename_GmCerts_)); |
241 | iClob(new_File(collect_String(concatCStr_Path(&d->saveDir, identsFilename_GmCerts_)))); | 242 | const iString *path = collect_String(concatCStr_Path(&d->saveDir, identsFilename_GmCerts_)); |
243 | iFile *f = iClob(new_File(fileExists_FileInfo(path) ? path : oldPath)); | ||
242 | if (open_File(f, readOnly_FileMode)) { | 244 | if (open_File(f, readOnly_FileMode)) { |
243 | char magic[4]; | 245 | char magic[4]; |
244 | readData_File(f, sizeof(magic), magic); | 246 | readData_File(f, sizeof(magic), magic); |