skip blank lines and "_end" from objdump
authormarc <devnull@localhost>
Sat, 20 Jul 1996 22:19:18 +0000 (22:19 +0000)
committermarc <devnull@localhost>
Sat, 20 Jul 1996 22:19:18 +0000 (22:19 +0000)
skip lead "/" in filenames passed to ldd

CVS patchset: 904
CVS date: 1996/07/20 22:19:18

build/reqprov.c

index 78a0170..e488fe0 100644 (file)
@@ -110,9 +110,12 @@ static void parseFileForProv(char *f, struct PackageRec *p)
        soname[0] = '\0';
        fgets(soname, sizeof(soname)-1, pipe);
        pclose(pipe);
-       if ((len = strlen(soname))) {
+       /* length 1 lines are empty */
+       if ((len = strlen(soname)) > 1) {
            soname[len-1] = '\0';
-           addReqProv(p, REQUIRE_PROVIDES, soname, NULL);
+           /* Skip "_end" results */
+           if (strcmp(soname, "_end"))
+               addReqProv(p, REQUIRE_PROVIDES, soname, NULL);
        }
     }
 }
@@ -191,8 +194,9 @@ int generateAutoReqProv(Header header, struct PackageRec *p)
     writeBytesLeft = 0;
     while (count--) {
         s = *f++;
-        writeBytesLeft += strlen(s) + 1;
-        appendLineStringBuf(writeBuff, s);
+       /* We skip the leading "/" (already normalized) */
+        writeBytesLeft += strlen(s);
+        appendLineStringBuf(writeBuff, s + 1);
        parseFileForProv(s, p);
     }
     writePtr = getStringBuf(writeBuff);