D21204: Ensure no trailing slash in mountpoint read from fstab file.

Aleix Pol Gonzalez noreply at phabricator.kde.org
Tue May 14 13:33:09 BST 2019


apol added inline comments.

INLINE COMMENTS

> fstabhandling.cpp:169
> +            // strips last slash
> +            if (mountpoint.at(mountpoint.length() -1) == '/') {
> +                mountpoint = mountpoint.left(mountpoint.length() - 2);

mountpoint.endsWith(QLatin1Char('/'))

> fstabhandling.cpp:170
> +            if (mountpoint.at(mountpoint.length() -1) == '/') {
> +                mountpoint = mountpoint.left(mountpoint.length() - 2);
> +            }

you can call mountpoint.chop(2) for the same effect, which should be easier to read.

> fstabhandling.cpp:217
> +            // strips last slash
> +            if (mountpoint.at(mountpoint.length() -1) == '/') {
> +                mountpoint = mountpoint.left(mountpoint.length() - 2);

Same as above.

REPOSITORY
  R245 Solid

REVISION DETAIL
  https://phabricator.kde.org/D21204

To: meven
Cc: apol, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190514/66dbeb21/attachment.html>


More information about the Kde-frameworks-devel mailing list