diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2017-12-13 20:10:04 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2017-12-14 17:01:05 +0100 |
commit | 074ddc05962e643b129cacbe81a20640cfd8fe19 (patch) | |
tree | 67dd274b4f2c8dc0724ca3a99281c9e16cc86a8a /core/file.c | |
parent | 375490dfc9dddb01be8a4f484437580e679a0047 (diff) | |
download | subsurface-074ddc05962e643b129cacbe81a20640cfd8fe19.tar.gz |
Remove function isCloudUrl()
The function isCloudUrl() was only called in one place, parse_file().
But, isCloudUrl() could only return true if the filename was of the
git-repository kind (url[branch]). In such a case, control flow would
never reach the point where isCloudUrl() is called, since
is_git_repository() returns non-NULL and the function returns early.
Therefore, remove this function. Moreover, adapt the affected if-statement
by replacing "str && !strcmp(str, ...)" with the more concise
"same_string(str, ...)".
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/file.c')
-rw-r--r-- | core/file.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/file.c b/core/file.c index 874a4e2c3..e818c9e21 100644 --- a/core/file.c +++ b/core/file.c @@ -497,9 +497,8 @@ int parse_file(const char *filename) return git_load_dives(git, branch); if ((ret = readfile(filename, &mem)) < 0) { - /* we don't want to display an error if this was the default file or the cloud storage */ - if ((prefs.default_filename && !strcmp(filename, prefs.default_filename)) || - isCloudUrl(filename)) + /* we don't want to display an error if this was the default file */ + if (same_string(filename, prefs.default_filename)) return 0; return report_error(translate("gettextFromC", "Failed to read '%s'"), filename); |