Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/usr.bin/make



Module Name:    src
Committed By:   rillig
Date:           Sun Aug 23 17:49:37 UTC 2020

Modified Files:
        src/usr.bin/make: arch.c

Log Message:
make(1): replace tricky malloc+realloc+strlen+snprintf with Buffer

The code for handling archives is not widely used.  Therefore it does
not need to be fast.  Clarity of the code is more important.  Therefore
replace the malloc + strlen + realloc + snprintf string processing with
the Buffer type, which removes a lot of redundancy.

In the wildcard loop, the "if (sz > nsz)" looked like a mistake.  Why
should it be useful to first allocate a large buffer and then resize it
to a smaller buffer, but still twice as large as necessary?


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/usr.bin/make/arch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index