Panu Matilainen 154e7d
commit 1b9e6d7f48a68fd677c70d04c9a6bb4274cf7b9f
Panu Matilainen 154e7d
Author: Florian Festi <ffesti@redhat.com>
Panu Matilainen 154e7d
Date:   Tue Jun 16 17:37:40 2009 +0200
Panu Matilainen 154e7d
Panu Matilainen 154e7d
    Fix Segfault for to be installed symlinks pointing to existing locations
Panu Matilainen 154e7d
    fixes rhbz#505777
Panu Matilainen 154e7d
Panu Matilainen 154e7d
diff --git a/lib/fprint.c b/lib/fprint.c
Panu Matilainen 154e7d
index d32eec1..e57ba20 100644
Panu Matilainen 154e7d
--- a/lib/fprint.c
Panu Matilainen 154e7d
+++ b/lib/fprint.c
Panu Matilainen 154e7d
@@ -311,10 +311,10 @@ void fpLookupSubdir(rpmFpHash symlinks, rpmFpHash fphash, fingerPrintCache fpc,
Panu Matilainen 154e7d
 		   /* setup current_fp for the new path */
Panu Matilainen 154e7d
 		   found = 1;
Panu Matilainen 154e7d
 		   current_fp = *fp;
Panu Matilainen 154e7d
-		   if (!fp->subDir) {
Panu Matilainen 154e7d
-		     lensubDir = 0;
Panu Matilainen 154e7d
-		     currentsubdir = endsubdir = NULL;
Panu Matilainen 154e7d
-		     break;
Panu Matilainen 154e7d
+		   if (fp->subDir == NULL) {
Panu Matilainen 154e7d
+		     /* directory exists - no need to look for symlinks */
Panu Matilainen 154e7d
+		     rpmFpHashAddEntry(fphash, fp, ffi);
Panu Matilainen 154e7d
+		     return;
Panu Matilainen 154e7d
 		   }
Panu Matilainen 154e7d
 		   lensubDir = strlen(fp->subDir);
Panu Matilainen 154e7d
 		   currentsubdir = xstrdup(fp->subDir);