Only match uninstalled packages that end in "-uninstalled" with hyphen

pkg-config(1) states that installed packages should be appended with
"-uninstalled". However, the code was checking only for trailing
"uninstalled" without the hyphen. Make the code consistent with the
documentation.

Freedesktop #54379
This commit is contained in:
Dan Nicholson 2012-10-13 09:25:34 -07:00
parent 1184d2085a
commit 3aa62167be

6
pkg.c
View file

@ -106,8 +106,8 @@ ends_in_dotpc (const char *str)
return FALSE;
}
/* strlen ("uninstalled") */
#define UNINSTALLED_LEN 11
/* strlen ("-uninstalled") */
#define UNINSTALLED_LEN 12
gboolean
name_ends_in_uninstalled (const char *str)
@ -115,7 +115,7 @@ name_ends_in_uninstalled (const char *str)
int len = strlen (str);
if (len > UNINSTALLED_LEN &&
FOLDCMP ((str + len - UNINSTALLED_LEN), "uninstalled") == 0)
FOLDCMP ((str + len - UNINSTALLED_LEN), "-uninstalled") == 0)
return TRUE;
else
return FALSE;