Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f129e84a authored by Bernhard Rosenkraenzer's avatar Bernhard Rosenkraenzer
Browse files

Fix comparison of String8 to char* literal



Clang (correctly) interprets

if ("." == sName)

as

if ("." == (const char*)sName)

and recognizes that comparing the pointers isn't what was meant.

With

if (sName == ".")

both clang and gcc see and use String8::operator==(const char *),
ensuring we get the wanted behavior.

Change-Id: Ide240e13214a56f6899f72de3db75dac647e6d4b
Signed-off-by: default avatarBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
parent 14fc930d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ private:
     */
    bool isDotOrDDot(const struct dirent* pEntry) const {
        String8 sName(pEntry->d_name);
        return "." == sName || ".." == sName;
        return sName == "." || sName == "..";
    }

    /**