Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
This commit is contained in:
parent
77a0a5b519
commit
fa325e9b42
1021 changed files with 5688 additions and 6193 deletions
|
|
@ -42,7 +42,7 @@ g% cdsector 3149 | xd -b # 0x0c4d
|
|||
55 aa - magic
|
||||
|
||||
0000020 88 - 88 = bootable
|
||||
03 - 3 = 2.88MB diskette
|
||||
03 - 3 = 2.88MB diskette
|
||||
00 00 - load segment 0 means default 0x7C0
|
||||
00 - system type (byte 5 of boot image)
|
||||
00 - unused (0)
|
||||
|
|
@ -58,13 +58,13 @@ g% cdsector `{h2d 0c4e} | xd -b
|
|||
1+0 records out
|
||||
0000000 eb 3c 00 00 00 00 00 00 00 00 00 00 02 00 00 00
|
||||
0000010 00 00 00 00 00 00 00 00 12 00 02 00 00 00 00 00
|
||||
0000020 00 00 00 00 00 16 1f 66 6a 00 51 50 06 53
|
||||
0000020 00 00 00 00 00 16 1f 66 6a 00 51 50 06 53
|
||||
31 c0
|
||||
|
||||
FREEBSD
|
||||
0000000 eb 3c 00 00 00 00 00 00 00 00 00 00 02 00 00 00
|
||||
0000010 00 00 00 00 00 00 00 00 12 00 02 00 00 00 00 00
|
||||
0000020 00 00 00 00 00 16 1f 66 6a 00 51 50 06 53
|
||||
0000020 00 00 00 00 00 16 1f 66 6a 00 51 50 06 53
|
||||
31 c0
|
||||
|
||||
DOS 5
|
||||
|
|
@ -171,7 +171,7 @@ Cupdatebootcat(Cdimg *cd)
|
|||
Cputc(cd, 0); /* unused */
|
||||
Cputnl(cd, 1, 2); /* 512-byte sector count for load */
|
||||
Cputnl(cd, cd->bootdirec->block, 4); /* ptr to disk image */
|
||||
Cwseek(cd, o);
|
||||
Cwseek(cd, o);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ opencd(char *file, Cdinfo info)
|
|||
}
|
||||
|
||||
/* lowercase because of isostring */
|
||||
if(strstr(cd->iso.systemid, "iso9660") == nil
|
||||
if(strstr(cd->iso.systemid, "iso9660") == nil
|
||||
&& strstr(cd->iso.systemid, "utf8") == nil) {
|
||||
werrstr("unknown systemid %s", cd->iso.systemid);
|
||||
free(cd);
|
||||
|
|
@ -133,7 +133,7 @@ opencd(char *file, Cdinfo info)
|
|||
close(xfd);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
||||
if(strstr(cd->iso.systemid, "plan 9"))
|
||||
cd->flags |= CDplan9;
|
||||
if(strstr(cd->iso.systemid, "iso9660"))
|
||||
|
|
@ -307,7 +307,7 @@ parsedesc(Voldesc *v, Cvoldesc *cv, char *(*string)(uchar*, int))
|
|||
v->biblio = string(cv->biblio, sizeof cv->biblio);
|
||||
v->notice = string(cv->notice, sizeof cv->notice);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
readisodesc(Cdimg *cd, Voldesc *v)
|
||||
{
|
||||
|
|
@ -629,4 +629,3 @@ Clinelen(Cdimg *cd)
|
|||
{
|
||||
return Blinelen(&cd->brd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,9 +86,9 @@ walkdirec(Direc *d, char *name)
|
|||
* Add the file ``name'' with attributes d to the
|
||||
* directory ``root''. Name may contain multiple
|
||||
* elements; all but the last must exist already.
|
||||
*
|
||||
*
|
||||
* The child lists are kept sorted by utfname.
|
||||
*/
|
||||
*/
|
||||
Direc*
|
||||
adddirec(Direc *root, char *name, XDir *d)
|
||||
{
|
||||
|
|
@ -130,7 +130,7 @@ adddirec(Direc *root, char *name, XDir *d)
|
|||
return nd;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Copy the tree src into dst.
|
||||
*/
|
||||
void
|
||||
|
|
@ -219,4 +219,3 @@ dsort(Direc *d, int (*cmp)(const void*, const void*))
|
|||
for(i=0; i<n; i++)
|
||||
dsort(&d->child[i], cmp);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ adddumpdir(Direc *root, ulong now, XDir *dir)
|
|||
Tm tm;
|
||||
|
||||
tm = *localtime(now);
|
||||
|
||||
|
||||
sprint(buf, "%d", tm.year+1900);
|
||||
if((dyear = walkdirec(root, buf)) == nil) {
|
||||
dyear = adddirec(root, buf, dir);
|
||||
|
|
@ -406,7 +406,7 @@ hasdump(Cdimg *cd)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Direc
|
||||
readdumpdirs(Cdimg *cd, XDir *dir, char *(*cvt)(uchar*, int))
|
||||
{
|
||||
|
|
@ -500,7 +500,7 @@ readdumpconform(Cdimg *cd)
|
|||
if(tokenize(p, f, 2) != 2 || (f[0][0] != 'D' && f[0][0] != 'F')
|
||||
|| strlen(f[0]) != 7 || !isalldigit(f[0]+1))
|
||||
break;
|
||||
|
||||
|
||||
addtx(atom(f[1]), atom(f[0]));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ main(int argc, char **argv)
|
|||
Cwseek(cd, cd->nextblock*Blocksize);
|
||||
goto Dofix;
|
||||
}
|
||||
|
||||
|
||||
dumpname = adddumpdir(&idumproot, now, &dir);
|
||||
/* note that we assume all names are conforming and thus sorted */
|
||||
if(cd->flags & CDjoliet) {
|
||||
|
|
@ -192,7 +192,7 @@ main(int argc, char **argv)
|
|||
findbootimage(cd, &iroot);
|
||||
Cupdatebootcat(cd);
|
||||
}
|
||||
|
||||
|
||||
/* create Joliet tree */
|
||||
if(cd->flags & CDjoliet)
|
||||
copydirec(&jroot, &iroot);
|
||||
|
|
@ -235,14 +235,14 @@ main(int argc, char **argv)
|
|||
* Write incremental _conform.map block.
|
||||
*/
|
||||
wrconform(cd, cd->nconform, &cblock, &clength);
|
||||
|
||||
|
||||
/* jump here if we're just fixing up the cd */
|
||||
Dofix:
|
||||
/*
|
||||
* Write null dump header block; everything after this will be
|
||||
* Write null dump header block; everything after this will be
|
||||
* overwritten at the next dump. Because of this, it needs to be
|
||||
* reconstructable. We reconstruct the _conform.map and dump trees
|
||||
* from the header blocks in dump.c, and we reconstruct the path
|
||||
* from the header blocks in dump.c, and we reconstruct the path
|
||||
* tables by walking the cd.
|
||||
*/
|
||||
newnull = Cputdumpblock(cd);
|
||||
|
|
@ -254,12 +254,12 @@ Dofix:
|
|||
dir.mode = 0444;
|
||||
if(cd->flags & (CDconform|CDjoliet)) {
|
||||
if(!mk9660 && cd->nconform == 0){
|
||||
block = cblock;
|
||||
block = cblock;
|
||||
length = clength;
|
||||
}else
|
||||
wrconform(cd, 0, &block, &length);
|
||||
|
||||
if(mk9660)
|
||||
if(mk9660)
|
||||
{
|
||||
idumproot = iroot;
|
||||
jdumproot = jroot;
|
||||
|
|
@ -315,11 +315,11 @@ Dofix:
|
|||
copybutname(r, &jroot);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
writedumpdirs(cd, &idumproot, Cputisodir);
|
||||
if(cd->flags & CDjoliet)
|
||||
writedumpdirs(cd, &jdumproot, Cputjolietdir);
|
||||
|
||||
|
||||
/*
|
||||
* Patch in new root directory entry.
|
||||
*/
|
||||
|
|
@ -330,7 +330,7 @@ Dofix:
|
|||
setvolsize(cd, cd->jolietsvd, cd->nextblock*Blocksize);
|
||||
}
|
||||
}
|
||||
writepathtables(cd);
|
||||
writepathtables(cd);
|
||||
|
||||
if(!mk9660){
|
||||
/*
|
||||
|
|
@ -341,16 +341,16 @@ Dofix:
|
|||
if(cd->nulldump && maxsize && Cwoffset(cd) > maxsize){
|
||||
fprint(2, "too big; writing old tree back\n");
|
||||
status = "cd too big; aborted";
|
||||
|
||||
|
||||
rmdumpdir(&idumproot, dumpname);
|
||||
rmdumpdir(&jdumproot, dumpname);
|
||||
|
||||
|
||||
cd->nextblock = cd->nulldump+1;
|
||||
cd->nulldump = 0;
|
||||
Cwseek(cd, cd->nextblock*Blocksize);
|
||||
goto Dofix;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write old null header block; this commits all our changes.
|
||||
*/
|
||||
|
|
@ -399,4 +399,3 @@ addprotofile(char *new, char *old, Dir *d, void *a)
|
|||
free(name);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ isostring(uchar *buf, int len)
|
|||
return q;
|
||||
}
|
||||
|
||||
int
|
||||
int
|
||||
isisofrog(char c)
|
||||
{
|
||||
if(c >= '0' && c <= '9')
|
||||
|
|
@ -85,7 +85,7 @@ isbadiso9660(char *s)
|
|||
|
||||
/*
|
||||
* ISO9660 name comparison
|
||||
*
|
||||
*
|
||||
* The standard algorithm is as follows:
|
||||
* Take the filenames without extensions, pad the shorter with 0x20s (spaces),
|
||||
* and do strcmp. If they are equal, go on.
|
||||
|
|
@ -169,7 +169,7 @@ Cputisopvd(Cdimg *cd, Cdinfo info)
|
|||
strcat(buf, "iso9660");
|
||||
else
|
||||
strcat(buf, "utf8");
|
||||
|
||||
|
||||
struprcpy(buf, buf);
|
||||
Cputs(cd, buf, 32);
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ struct Voldesc {
|
|||
ulong mpathloc;
|
||||
|
||||
/* root of file tree */
|
||||
Direc root;
|
||||
Direc root;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -116,7 +116,7 @@ struct Cdimg {
|
|||
ulong bootimageptr;
|
||||
Direc *bootdirec;
|
||||
char *bootimage;
|
||||
|
||||
|
||||
Biobuf brd;
|
||||
Biobuf bwr;
|
||||
|
||||
|
|
@ -406,7 +406,7 @@ int Cputisodir(Cdimg*, Direc*, int, int, int);
|
|||
int Cputjolietdir(Cdimg*, Direc*, int, int, int);
|
||||
void Cputendvd(Cdimg*);
|
||||
|
||||
enum {
|
||||
enum {
|
||||
Blocksize = 2048,
|
||||
Ndirblock = 16, /* directory blocks allocated at once */
|
||||
|
||||
|
|
|
|||
|
|
@ -26,15 +26,15 @@ jolietstring(uchar *buf, int len)
|
|||
}
|
||||
|
||||
/*
|
||||
* Joliet name validity check
|
||||
*
|
||||
* Joliet name validity check
|
||||
*
|
||||
* Joliet names have length at most 128 bytes (64 runes),
|
||||
* and cannot contain '*', '/', ':', ';', '?', or '\'.
|
||||
*/
|
||||
int
|
||||
isjolietfrog(Rune r)
|
||||
{
|
||||
return r=='*' || r=='/' || r==':'
|
||||
return r=='*' || r=='/' || r==':'
|
||||
|| r==';' || r=='?' || r=='\\';
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ isbadjoliet(char *s)
|
|||
* The standard algorithm is the ISO9660 algorithm but
|
||||
* on the encoded Runes. Runes are encoded in big endian
|
||||
* format, so we can just use runecmp.
|
||||
*
|
||||
*
|
||||
* Padding is with zeros, but that still doesn't affect us.
|
||||
*/
|
||||
|
||||
|
|
@ -135,4 +135,3 @@ Cputjolietsvd(Cdimg *cd, Cdinfo info)
|
|||
Cputc(cd, 1); /* file structure version */
|
||||
Cpadblock(cd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
* Add the requisite path tables to the CD image.
|
||||
* They get put on the end once everything else is done.
|
||||
* We use the path table itself as a queue in the breadth-first
|
||||
* traversal of the tree.
|
||||
* traversal of the tree.
|
||||
*
|
||||
* The only problem with this is that the path table does not
|
||||
* store the lengths of the directories. So we keep an explicit
|
||||
|
|
|
|||
|
|
@ -36,4 +36,3 @@ runecmp(Rune *s, Rune *t)
|
|||
s++, t++;
|
||||
return *s - *t;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@ setcelen(Cdimg *cd, ulong woffset, ulong len)
|
|||
* Rock Ridge data is put into little blockettes, which can be
|
||||
* at most 256 bytes including a one-byte length. Some number
|
||||
* of blockettes get packed together into a normal 2048-byte block.
|
||||
* Blockettes cannot cross block boundaries.
|
||||
* Blockettes cannot cross block boundaries.
|
||||
*
|
||||
* A Cbuf is a blockette buffer. Len contains
|
||||
* A Cbuf is a blockette buffer. Len contains
|
||||
* the length of the buffer written so far, and we can
|
||||
* write up to 254-28.
|
||||
* write up to 254-28.
|
||||
*
|
||||
* We only have one active Cbuf at a time; cdimg.rrcontin is the byte
|
||||
* offset of the beginning of that Cbuf.
|
||||
|
|
@ -94,7 +94,7 @@ ensurespace(Cdimg *cd, int n, Cbuf *co, Cbuf *cn, int dowrite)
|
|||
|
||||
/*
|
||||
* the current blockette is full; update cd->rrcontin and then
|
||||
* write a CE record to finish it. Unfortunately we need to
|
||||
* write a CE record to finish it. Unfortunately we need to
|
||||
* figure out which block will be next before we write the CE.
|
||||
*/
|
||||
end = Cwoffset(cd)+28;
|
||||
|
|
@ -134,13 +134,13 @@ ensurespace(Cdimg *cd, int n, Cbuf *co, Cbuf *cn, int dowrite)
|
|||
|
||||
return cn;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Put down the name, but we might need to break it
|
||||
* into chunks so that each chunk fits in 254-28-5 bytes.
|
||||
* What a crock.
|
||||
*
|
||||
* The new Plan 9 format uses strings of this form too,
|
||||
* The new Plan 9 format uses strings of this form too,
|
||||
* since they're already there.
|
||||
*/
|
||||
Cbuf*
|
||||
|
|
@ -211,7 +211,7 @@ Cputsysuse(Cdimg *cd, Direc *d, int dot, int dowrite, int initlen)
|
|||
what |= RR_SL;
|
||||
|
||||
m = CputsuspRR(cd, what, 0);
|
||||
cp = ensurespace(cd, m, cp, &cn, dowrite);
|
||||
cp = ensurespace(cd, m, cp, &cn, dowrite);
|
||||
CputsuspRR(cd, what, dowrite);
|
||||
|
||||
if(what & RR_PX) {
|
||||
|
|
@ -235,7 +235,7 @@ Cputsysuse(Cdimg *cd, Direc *d, int dot, int dowrite, int initlen)
|
|||
|
||||
/*
|
||||
* Put down the symbolic link. This is even more of a crock.
|
||||
* Not only are the individual elements potentially split,
|
||||
* Not only are the individual elements potentially split,
|
||||
* but the whole path itself can be split across SL blocks.
|
||||
* To keep the code simple as possible (really), we write
|
||||
* only one element per SL block, wasting 6 bytes per element.
|
||||
|
|
@ -382,7 +382,7 @@ CputsuspSP(Cdimg *cd, int dowrite)
|
|||
{
|
||||
assert(cd!=0);
|
||||
|
||||
if(dowrite) {
|
||||
if(dowrite) {
|
||||
chat("writing SUSP SP record\n");
|
||||
Cputc(cd, 'S'); /* SP field marker */
|
||||
Cputc(cd, 'P');
|
||||
|
|
@ -406,7 +406,7 @@ CputsuspST(Cdimg *cd, int dowrite)
|
|||
Cputc(cd, 'S'); /* ST field marker */
|
||||
Cputc(cd, 'T');
|
||||
Cputc(cd, 4); /* Length */
|
||||
Cputc(cd, 1); /* Version */
|
||||
Cputc(cd, 1); /* Version */
|
||||
}
|
||||
return 4;
|
||||
}
|
||||
|
|
@ -484,7 +484,7 @@ CputrripPX(Cdimg *cd, Direc *d, int dot, int dowrite)
|
|||
Cputc(cd, 'X');
|
||||
Cputc(cd, 36); /* Length */
|
||||
Cputc(cd, 1); /* Version */
|
||||
|
||||
|
||||
Cputn(cd, mode(d, dot), 4); /* POSIX File mode */
|
||||
Cputn(cd, nlink(d), 4); /* POSIX st_nlink */
|
||||
Cputn(cd, d?d->uidno:0, 4); /* POSIX st_uid */
|
||||
|
|
@ -514,7 +514,7 @@ CputrripTF(Cdimg *cd, Direc *d, int type, int dowrite)
|
|||
Cputc(cd, 5+7*length); /* Length */
|
||||
Cputc(cd, 1); /* Version */
|
||||
Cputc(cd, type); /* Flags (types) */
|
||||
|
||||
|
||||
if (type & TFcreation)
|
||||
Cputdate(cd, d?d->ctime:0);
|
||||
if (type & TFmodify)
|
||||
|
|
@ -523,7 +523,7 @@ CputrripTF(Cdimg *cd, Direc *d, int type, int dowrite)
|
|||
Cputdate(cd, d?d->atime:0);
|
||||
if (type & TFattributes)
|
||||
Cputdate(cd, d?d->ctime:0);
|
||||
|
||||
|
||||
/* if (type & TFbackup) */
|
||||
/* Cputdate(cd, 0); */
|
||||
/* if (type & TFexpiration) */
|
||||
|
|
@ -566,7 +566,7 @@ static long
|
|||
mode(Direc *d, int dot)
|
||||
{
|
||||
long mode;
|
||||
|
||||
|
||||
if (!d)
|
||||
return 0;
|
||||
|
||||
|
|
@ -582,13 +582,13 @@ mode(Direc *d, int dot)
|
|||
mode = S_IFDIR | (0755);
|
||||
|
||||
mode &= POSIXMODEMASK;
|
||||
|
||||
|
||||
/* Botch: not all POSIX types supported yet */
|
||||
assert(mode & (S_IFDIR|S_IFREG));
|
||||
|
||||
chat("writing PX record mode field %ulo with dot %d and name \"%s\"\n", mode, dot, d->name);
|
||||
chat("writing PX record mode field %ulo with dot %d and name \"%s\"\n", mode, dot, d->name);
|
||||
|
||||
return mode;
|
||||
return mode;
|
||||
}
|
||||
|
||||
static long
|
||||
|
|
@ -610,4 +610,3 @@ nlink(Direc *d) /* Trump up the nlink field for POSIX compliance */
|
|||
|
||||
return n;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ atom(char *str)
|
|||
{
|
||||
uint h;
|
||||
Stringtab *tab;
|
||||
|
||||
|
||||
h = hash(str) % nelem(stab);
|
||||
for(tab=stab[h]; tab; tab=tab->link)
|
||||
if(strcmp(str, tab->str) == 0)
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ writefiles(Dump *d, Cdimg *cd, Direc *direc)
|
|||
assert(start != 0);
|
||||
|
||||
Cwseek(cd, start*Blocksize);
|
||||
|
||||
|
||||
s = md5(nil, 0, nil, nil);
|
||||
length = 0;
|
||||
while((n = Bread(b, buf, sizeof buf)) > 0) {
|
||||
|
|
@ -123,7 +123,7 @@ writefiles(Dump *d, Cdimg *cd, Direc *direc)
|
|||
}
|
||||
|
||||
/*
|
||||
* Write a directory tree. We work from the leaves,
|
||||
* Write a directory tree. We work from the leaves,
|
||||
* and patch the dotdot pointers afterward.
|
||||
*/
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue