rpm/rpm-5.4.9-avoid-double-slash-in-path-for-dirname-filetrigger-matching.patch
2013-03-27 12:51:15 +04:00

23 lines
824 B
Diff

--- rpm-5.4.9/lib/psm.c.slash~ 2012-05-15 03:47:32.000000000 +0200
+++ rpm-5.4.9/lib/psm.c 2012-05-15 03:49:04.075347677 +0200
@@ -1463,11 +1463,15 @@ static rpmRC runTriggersLoop(rpmpsm psm,
ARGint_t vals;
depName = _free(depName);
- depName = (char *) xmalloc(nName + 1 + 1);
- (void) stpcpy(depName, Name);
- /* XXX re-add the pesky trailing '/' to dirnames. */
- depName[nName] = (tagno == RPMTAG_DIRNAMES ? '/' : '\0');
- depName[nName+1] = '\0';
+ if (!strcmp(Name, "/"))
+ depName = xstrdup(Name);
+ else {
+ depName = xmalloc(nName + 1 + 1);
+ (void) stpcpy(depName, Name);
+ /* XXX re-add the pesky trailing '/' to dirnames. */
+ depName[nName] = (tagno == RPMTAG_DIRNAMES ? '/' : '\0');
+ depName[nName+1] = '\0';
+ }
if (depName[0] == '/' && psm->Tmires != NULL) {
miRE mire;