diff --git a/build/rpmfc.c b/build/rpmfc.c index f3064739c3..3fdd1049e0 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -1184,10 +1184,11 @@ static int initAttrs(rpmfc fc) /* Discover known attributes from pathnames + initialize them */ if (rpmGlob(attrPath, NULL, &files) == 0) { - nattrs = argvCount(files); + nattrs = argvCount(files) + 1; fc->atypes = xcalloc(nattrs + 1, sizeof(*fc->atypes)); - for (int i = 0; i < nattrs; i++) { - char *bn = basename(files[i]); + fc->atypes[0] = rpmfcAttrNew("local_generator"); + for (int i = 1; i < nattrs; i++) { + char *bn = basename(files[i - 1]); bn[strlen(bn)-strlen(".attr")] = '\0'; fc->atypes[i] = rpmfcAttrNew(bn); }