]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/cp-namespace.c
New common function "startswith"
[thirdparty/binutils-gdb.git] / gdb / cp-namespace.c
index 4f684321929e00b648bd4f62f088cd67693d6c85..4a00cb62e6679e3125adb669dfc091da3fa9fc65 100644 (file)
@@ -497,8 +497,7 @@ cp_lookup_symbol_via_imports (const char *scope,
 
       len = strlen (current->import_dest);
       directive_match = (search_parents
-                         ? (strncmp (scope, current->import_dest,
-                                     strlen (current->import_dest)) == 0
+                         ? (startswith (scope, current->import_dest)
                             && (len == 0
                                 || scope[len] == ':'
                                || scope[len] == '\0'))