mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't show error if cloud credentials aren't set up
This became rather obvious with the change to immediately show errors. The commit also fixes a small memory leak. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f088aa4c8b
commit
3b92585a47
1 changed files with 11 additions and 7 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue