summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2011-10-08 01:16:51 +0000
committerJason Woodward2011-10-08 01:16:51 +0000
commit502e669a981e95da75033973890def0b51314e38 (patch)
treec3c4401e9d71eac51daef982bffa170ed71fb039
parent51af269b85494de3dd0aac0655e70a6c6f2243c2 (diff)
downloadslapt-get-502e669a981e95da75033973890def0b51314e38.tar.gz
Updated required_by pattern to match required declarations
Make sure to match both the beginning and end of lines along with the existing middle.
-rw-r--r--src/package.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/package.c b/src/package.c
index 9e67592..9bd7529 100644
--- a/src/package.c
+++ b/src/package.c
@@ -1765,10 +1765,10 @@ static void required_by(slapt_pkg_list_t *avail,
unsigned int i;
slapt_regex_t *required_by_reg = NULL;
char *pkg_name = escape_package_name(pkg);
- int reg_str_len = strlen(pkg_name) + 29;
+ int reg_str_len = strlen(pkg_name) + 31;
char *reg = slapt_malloc(sizeof *reg * reg_str_len);
/* add word boundary to search */
- int sprintf_r = snprintf(reg, (size_t)reg_str_len, "[^a-zA-Z0-9\\-]%s[^a-zA-Z0-9\\-]", pkg_name);
+ int sprintf_r = snprintf(reg, (size_t)reg_str_len, "[^a-zA-Z0-9\\-]*%s[^a-zA-Z0-9\\-]*", pkg_name);
if (sprintf_r < 0) {
fprintf(stderr,"sprintf error for %s\n", pkg_name);