Browse code

add support for last.hdb in bytecode.cvd

Tomasz Kojm authored on 2010/05/11 01:21:21
Showing 1 changed files
... ...
@@ -716,6 +716,28 @@ static int build(const struct optstruct *opts)
716 716
 		}
717 717
 	    }
718 718
 	    closedir(dd);
719
+	    if(!access("last.hdb", R_OK)) {
720
+		if(!dblist2) {
721
+		    mprintf("!build: dblist2 == NULL (no .cbc files?)\n");
722
+		    return -1;
723
+		}
724
+		lspt = dblist2;
725
+		while(lspt->next)
726
+		    lspt = lspt->next;
727
+		lspt->next = (struct dblist_scan *) malloc(sizeof(struct dblist_scan));
728
+		if(!lspt->next) {
729
+		    FREE_LS(dblist2);
730
+		    mprintf("!build: Memory allocation error\n");
731
+		    return -1;
732
+		}
733
+		lspt->next->name = strdup("last.hdb");
734
+		if(!lspt->next->name) {
735
+		    FREE_LS(dblist2);
736
+		    mprintf("!build: Memory allocation error\n");
737
+		    return -1;
738
+		}
739
+		entries += countlines("last.hdb");
740
+	    }
719 741
 	} else {
720 742
 	    for(i = 0; dblist[i].name; i++)
721 743
 		if(dblist[i].count && strstr(dblist[i].name, dbname) && !access(dblist[i].name, R_OK))