URI:
       ranlib: Fix detection of previous index - scc - simple c99 compiler
  HTML git clone git://git.simple-cc.org/scc
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 6abf674372bf77c7bcd7ed762b3791c67b7fdf47
   DIR parent e9fd2f28fb1200643f668d500c1239a4154d0cb1
  HTML Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
       Date:   Fri,  8 May 2026 18:44:35 +0200
       
       ranlib: Fix detection of previous index
       
       The strncmp was wrong because after the end of the member name
       the ar format has spaces that are not going to match with the
       end of string. Also, it didn't consider the padding of ar members
       which has to be 2 bytes.
       
       Diffstat:
         M src/cmd/scc-ranlib.c                |       8 +++++---
       
       1 file changed, 5 insertions(+), 3 deletions(-)
       ---
   DIR diff --git a/src/cmd/scc-ranlib.c b/src/cmd/scc-ranlib.c
       @@ -237,10 +237,12 @@ merge(FILE *to, struct fprop *prop, FILE *lib, FILE *idx)
                if (fread(&first, sizeof(first), 1, lib) != 1)
                        return;
        
       -        if (!strncmp(first.ar_name, namidx, SARNAM))
       -                fseek(lib, atol(first.ar_size), SEEK_CUR);
       -        else
       +        if (!strncmp(first.ar_name, namidx, strlen(namidx))) {
       +                long siz = atol(first.ar_size);
       +                fseek(lib, siz + (siz & 1), SEEK_CUR);
       +        } else {
                        fseek(lib, SARMAG, SEEK_SET);
       +        }
        
                fwrite(ARMAG, SARMAG, 1, to);