From: Matthew Fernandez Date: Thu, 3 Nov 2022 01:56:08 +0000 (-0700) Subject: common: abbreviate a prefix check X-Git-Tag: 7.0.1~5^2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=939d6d9647d411a487590d09cdd3d8b411e6830c;p=graphviz common: abbreviate a prefix check --- diff --git a/lib/common/arrows.c b/lib/common/arrows.c index 28688ec9c..6e90cdea7 100644 --- a/lib/common/arrows.c +++ b/lib/common/arrows.c @@ -10,6 +10,7 @@ #include +#include #include #include #include @@ -151,7 +152,7 @@ static char *arrow_match_name_frag(char *name, const arrowname_t *arrownames, for (const arrowname_t *arrowname = arrownames; arrowname->name; arrowname++) { namelen = strlen(arrowname->name); - if (strncmp(name, arrowname->name, namelen) == 0) { + if (startswith(name, arrowname->name)) { *flag |= arrowname->type; rest += namelen; break;