diff options
Diffstat (limited to 'vswitchd/bridge.c')
-rw-r--r-- | vswitchd/bridge.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 82c3bffc8..dd3099f84 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -2740,8 +2740,12 @@ static bool equal_pathnames(const char *a, const char *b, size_t b_stoplen) { const char *b_start = b; - while (b - b_start < b_stoplen && *a == *b) { - if (*a == '/') { + for (;;) { + if (b - b_start >= b_stoplen) { + return true; + } else if (*a != *b) { + return false; + } else if (*a == '/') { a += strspn(a, "/"); b += strspn(b, "/"); } else if (*a == '\0') { @@ -2751,7 +2755,6 @@ equal_pathnames(const char *a, const char *b, size_t b_stoplen) b++; } } - return false; } static void |