diff options
author | David Robillard <d@drobilla.net> | 2020-12-31 14:07:31 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-31 14:07:31 +0100 |
commit | 7a51f0b8e95d29b5e053db97bf72094e847ee7ef (patch) | |
tree | 388ce4b62ee033777125370be4105c5b8aa8b2df /src/filesystem.c | |
parent | a5a72832c05ba2894d90def0b74128a93dcca937 (diff) | |
download | lilv-7a51f0b8e95d29b5e053db97bf72094e847ee7ef.tar.gz lilv-7a51f0b8e95d29b5e053db97bf72094e847ee7ef.tar.bz2 lilv-7a51f0b8e95d29b5e053db97bf72094e847ee7ef.zip |
Avoid "else" after "return"
Diffstat (limited to 'src/filesystem.c')
-rw-r--r-- | src/filesystem.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/filesystem.c b/src/filesystem.c index b674113..dadd977 100644 --- a/src/filesystem.c +++ b/src/filesystem.c @@ -126,12 +126,12 @@ lilv_path_absolute(const char* path) { if (lilv_path_is_absolute(path)) { return lilv_strdup(path); - } else { - char* cwd = getcwd(NULL, 0); - char* abs_path = lilv_path_join(cwd, path); - free(cwd); - return abs_path; } + + char* cwd = getcwd(NULL, 0); + char* abs_path = lilv_path_join(cwd, path); + free(cwd); + return abs_path; } char* @@ -204,12 +204,13 @@ lilv_path_parent(const char* path) if (s == path) { // Hit beginning return lilv_is_dir_sep(*s) ? lilv_strdup("/") : lilv_strdup("."); - } else { // Pointing to the last character of the result (inclusive) - char* dirname = (char*)malloc(s - path + 2); - memcpy(dirname, path, s - path + 1); - dirname[s - path + 1] = '\0'; - return dirname; } + + // Pointing to the last character of the result (inclusive) + char* dirname = (char*)malloc(s - path + 2); + memcpy(dirname, path, s - path + 1); + dirname[s - path + 1] = '\0'; + return dirname; } char* |