New common function "startswith"
[deliverable/binutils-gdb.git] / gdb / guile / scm-type.c
index 196b4a13633253af8683ef4fa6c0fd391ce35a08..d21a7aec8c1eaa4d5705a2be32286ccbe8a25358 100644 (file)
@@ -1216,11 +1216,11 @@ tyscm_lookup_typename (const char *type_name, const struct block *block)
 
   TRY_CATCH (except, RETURN_MASK_ALL)
     {
-      if (!strncmp (type_name, "struct ", 7))
+      if (startswith (type_name, "struct "))
        type = lookup_struct (type_name + 7, NULL);
-      else if (!strncmp (type_name, "union ", 6))
+      else if (startswith (type_name, "union "))
        type = lookup_union (type_name + 6, NULL);
-      else if (!strncmp (type_name, "enum ", 5))
+      else if (startswith (type_name, "enum "))
        type = lookup_enum (type_name + 5, NULL);
       else
        type = lookup_typename (current_language, get_current_arch (),
This page took 0.023472 seconds and 4 git commands to generate.