diff --git a/chrome/src/nsChromeRegistry.cpp b/chrome/src/nsChromeRegistry.cpp index d360b160ae8a..aceef0939a35 100644 --- a/chrome/src/nsChromeRegistry.cpp +++ b/chrome/src/nsChromeRegistry.cpp @@ -214,19 +214,19 @@ LanguagesMatch(const nsACString& a, const nsACString& b) if (*as == '-') return PR_TRUE; + ++as; ++bs; + // reached the end if (as == ae && bs == be) return PR_TRUE; // "a" is short if (as == ae) - return (*++bs == '-'); + return (*bs == '-'); // "b" is short if (bs == be) - return (*++as == '-'); - - ++as; ++bs; + return (*as == '-'); } return PR_FALSE;