]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm-5.4.9-avoid-double-slash-in-path-for-dirname-filetrigger-matching.patch
- add fixes and useful features from Mandriva
[packages/rpm.git] / rpm-5.4.9-avoid-double-slash-in-path-for-dirname-filetrigger-matching.patch
diff --git a/rpm-5.4.9-avoid-double-slash-in-path-for-dirname-filetrigger-matching.patch b/rpm-5.4.9-avoid-double-slash-in-path-for-dirname-filetrigger-matching.patch
new file mode 100644 (file)
index 0000000..7535c34
--- /dev/null
@@ -0,0 +1,23 @@
+--- 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;
This page took 0.02688 seconds and 4 git commands to generate.