- within a region, entries sort by address; added drips sort by tag.
authorjbj <devnull@localhost>
Sat, 25 Aug 2001 01:54:58 +0000 (01:54 +0000)
committerjbj <devnull@localhost>
Sat, 25 Aug 2001 01:54:58 +0000 (01:54 +0000)
CVS patchset: 5028
CVS date: 2001/08/25 01:54:58

CHANGES
lib/header.c

diff --git a/CHANGES b/CHANGES
index c15294c..8e4c698 100644 (file)
--- a/CHANGES
+++ b/CHANGES
        - change dir creation message from warning to debug for now.
        - verify perms (but not mode) on %ghost files.
        - headers without RPMTAG_NAME are skipped when retrieved.
+       - within a region, entries sort by address; added drips sort by tag.
 
 4.0 -> 4.0.[12]
        - add doxygen and lclint annotations most everywhere.
index e7e7615..317760b 100644 (file)
@@ -167,8 +167,13 @@ static int offsetCmp(const void * avp, const void * bvp) /*@*/
     /*@=castexpose@*/
     int rc = (ap->info.offset - bp->info.offset);
 
-    if (rc == 0)
-       rc = (ap->info.tag - bp->info.tag);
+    if (rc == 0) {
+       /* Within a region, entries sort by address. Added drips sort by tag. */
+       if (ap->info.offset < 0)
+           rc = (((char *)ap->data) - ((char *)bp->data));
+       else
+           rc = (ap->info.tag - bp->info.tag);
+    }
     return rc;
 }
 
@@ -409,10 +414,6 @@ static int regionSwab(/*@null@*/ indexEntry entry, int il, int dl,
      */
     if (tl+REGION_TAG_COUNT == dl)
        tl += REGION_TAG_COUNT;
-#if 0
-    if (tl > dl)
-       dl = tl;
-#endif
 
     return dl;
 }
@@ -826,7 +827,7 @@ Header headerLoad(void * uh)
        if (hdrchkTags(entry->info.count))
            goto errxit;
 
-       {  int off = ntohl(pe->offset);
+       {   int off = ntohl(pe->offset);
 
            if (hdrchkData(off))
                goto errxit;
@@ -1617,11 +1618,7 @@ int headerAddI18NString(Header h, int_32 tag, const char * string, const char *
            entry->data = xrealloc(entry->data, entry->length + length);
 
        memset(((char *)entry->data) + entry->length, '\0', ghosts);
-#if 0
-       strcpy(((char *)entry->data) + entry->length + ghosts, string);
-#else
        memmove(((char *)entry->data) + entry->length + ghosts, string, strlen(string)+1);
-#endif
 
        entry->length += length;
        entry->info.count = langNum + 1;