diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-06 10:47:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-12 10:11:34 +0200 |
commit | 992a33313046f4a4d322db9464c474e7429a019a (patch) | |
tree | 494143e3070af872027ecaca840516d3101a881c /sal/osl/unx/file_url.cxx | |
parent | 77c1431ee88ab04a9ff48b849acedee6d455bafb (diff) |
clang-tidy: readability-else-after-return
run it against sal,cppu,cppuhelper
I had to run this multiple times to catch all the cases in each module,
and it requires some hand-tweaking of the resulting output - clang-tidy
is not very good about cleaning up trailing spaces, and aligning
things nicely.
Change-Id: I00336345f5f036e12422b98d66526509380c497a
Reviewed-on: https://gerrit.libreoffice.org/36194
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl/unx/file_url.cxx')
-rw-r--r-- | sal/osl/unx/file_url.cxx | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx index ddf2be4d8098..69ba4349b968 100644 --- a/sal/osl/unx/file_url.cxx +++ b/sal/osl/unx/file_url.cxx @@ -126,7 +126,7 @@ oslFileError getSystemPathFromFileUrl( } i = j + 1; break; - } else if (!rtl::isAsciiAlphanumeric(c) && c != '+' && c != '-' + } if (!rtl::isAsciiAlphanumeric(c) && c != '+' && c != '-' && c != '.') { break; @@ -202,10 +202,9 @@ oslFileError getSystemPathFromFileUrl( return osl_File_E_INVAL; } return getSystemPathFromFileUrl(home, path, false); - } else { - // FIXME: replace ~user with user's home directory - return osl_File_E_INVAL; } + // FIXME: replace ~user with user's home directory + return osl_File_E_INVAL; } return osl_File_E_None; } @@ -500,12 +499,12 @@ namespace punresolved++; continue; } - else if (*(punresolved + 1) == '/') + if (*(punresolved + 1) == '/') { punresolved += 2; continue; } - else if ((*(punresolved + 1) == '.') && (*(punresolved + 2) == '\0' || (*(punresolved + 2) == '/'))) + if ((*(punresolved + 1) == '.') && (*(punresolved + 2) == '\0' || (*(punresolved + 2) == '/'))) { _rmlastpathtoken(path_resolved_so_far); @@ -518,22 +517,21 @@ namespace continue; } - else // a file or directory name may start with '.' - { - if ((presolvedsf = ustrtoend(path_resolved_so_far)) > sentinel) - return oslTranslateFileError(OSL_FET_ERROR, ENAMETOOLONG); + // a file or directory name may start with '.' - ustrchrcat(*punresolved++, path_resolved_so_far); + if ((presolvedsf = ustrtoend(path_resolved_so_far)) > sentinel) + return oslTranslateFileError(OSL_FET_ERROR, ENAMETOOLONG); - if (*punresolved == '\0' && !realpath_failed) - { - ferr = _osl_resolvepath( - path_resolved_so_far, - &realpath_failed); + ustrchrcat(*punresolved++, path_resolved_so_far); - if (ferr != osl_File_E_None) - return ferr; - } + if (*punresolved == '\0' && !realpath_failed) + { + ferr = _osl_resolvepath( + path_resolved_so_far, + &realpath_failed); + + if (ferr != osl_File_E_None) + return ferr; } } else if (*punresolved == '/') |