summaryrefslogtreecommitdiffstats
path: root/core/subsurfacestartup.c
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2017-10-26 16:24:51 +0200
committerGravatar GitHub <noreply@github.com>2017-10-26 16:24:51 +0200
commita08e8a2d04821b4dcdfabe9f8e2d05a5cdac0d8d (patch)
tree463e846d897487bcaa628c7a8c03b601d4b263cd /core/subsurfacestartup.c
parent2c67b387ea5571675db68c46b7879b4746571fd9 (diff)
parent405923ecfdca7993a3f6433eba4f0de0d03161f5 (diff)
downloadsubsurface-a08e8a2d04821b4dcdfabe9f8e2d05a5cdac0d8d.tar.gz
Merge pull request #726 from Subsurface-divelog/rewriteErrorHandling
Rewrite error handling
Diffstat (limited to 'core/subsurfacestartup.c')
-rw-r--r--core/subsurfacestartup.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c
index c51080cd1..5147b3c37 100644
--- a/core/subsurfacestartup.c
+++ b/core/subsurfacestartup.c
@@ -163,20 +163,24 @@ void print_files()
const char *remote = 0;
const char *filename, *local_git;
- filename = cloud_url();
-
- is_git_repository(filename, &branch, &remote, true);
printf("\nFile locations:\n\n");
+ if (!same_string(prefs.cloud_storage_email, "") && !same_string(prefs.cloud_storage_password, "")) {
+ filename = cloud_url();
+
+ is_git_repository(filename, &branch, &remote, true);
+ } else {
+ /* strdup so the free below works in either case */
+ filename = strdup("No valid cloud credentials set.\n");
+ }
if (branch && remote) {
local_git = get_local_dir(remote, branch);
printf("Local git storage: %s\n", local_git);
} else {
printf("Unable to get local git directory\n");
}
- char *tmp = cloud_url();
- printf("Cloud URL: %s\n", tmp);
- free(tmp);
- tmp = hashfile_name_string();
+ printf("Cloud URL: %s\n", filename);
+ free((void *)filename);
+ char *tmp = hashfile_name_string();
printf("Image hashes: %s\n", tmp);
free(tmp);
tmp = picturedir_string();