mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Subject: ranlib fix for odd length long final file names (PR #82)
Submitted by: Peter Dufault <dufault@hda.com>
This commit is contained in:
parent
45f4664c72
commit
637cb583c9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=5213
1 changed files with 7 additions and 2 deletions
|
@ -276,6 +276,7 @@ copy_ar(cfp, size)
|
||||||
CF *cfp;
|
CF *cfp;
|
||||||
off_t size;
|
off_t size;
|
||||||
{
|
{
|
||||||
|
int pad_odd_read;
|
||||||
static char pad = '\n';
|
static char pad = '\n';
|
||||||
off_t sz;
|
off_t sz;
|
||||||
int from, nr, nw, off, to;
|
int from, nr, nw, off, to;
|
||||||
|
@ -299,8 +300,12 @@ copy_ar(cfp, size)
|
||||||
error(cfp->rname);
|
error(cfp->rname);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfp->flags & RPAD && (size + chdr.lname) & 1 &&
|
if (already_written)
|
||||||
(nr = read(from, buf, 1)) != 1) {
|
pad_odd_read = (cfp->flags & RPAD) && ((size + chdr.lname) & 1);
|
||||||
|
else
|
||||||
|
pad_odd_read = (cfp->flags & RPAD) && (size & 1);
|
||||||
|
|
||||||
|
if (pad_odd_read && (nr = read(from, buf, 1)) != 1) {
|
||||||
if (nr == 0)
|
if (nr == 0)
|
||||||
badfmt();
|
badfmt();
|
||||||
error(cfp->rname);
|
error(cfp->rname);
|
||||||
|
|
Loading…
Reference in a new issue