From fa325e9b42b0bdfb48857d1958d9fb7ceac55151 Mon Sep 17 00:00:00 2001 From: Dan Cross Date: Fri, 10 Jan 2020 14:44:21 +0000 Subject: 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 --- src/cmd/upas/fs/dat.h | 1 - src/cmd/upas/fs/fs.c | 8 ++++---- src/cmd/upas/fs/imap4.c | 10 +++++----- src/cmd/upas/fs/mbox.c | 5 ++--- src/cmd/upas/fs/pop3.c | 3 +-- src/cmd/upas/fs/strtotm.c | 4 ++-- src/cmd/upas/fs/tester.c | 2 +- 7 files changed, 15 insertions(+), 18 deletions(-) (limited to 'src/cmd/upas/fs') diff --git a/src/cmd/upas/fs/dat.h b/src/cmd/upas/fs/dat.h index 14208ed6..6264822d 100644 --- a/src/cmd/upas/fs/dat.h +++ b/src/cmd/upas/fs/dat.h @@ -218,4 +218,3 @@ void henter(ulong, char*, Qid, Message*, Mailbox*); void hfree(ulong, char*); ulong msgallocd, msgfreed; - diff --git a/src/cmd/upas/fs/fs.c b/src/cmd/upas/fs/fs.c index 9fa433d8..dc6ff3ba 100644 --- a/src/cmd/upas/fs/fs.c +++ b/src/cmd/upas/fs/fs.c @@ -760,7 +760,7 @@ rwalk(Fid *f) for(i = 0; i < thdr.nwname; i++){ rv = dowalk(f, thdr.wname[i]); if(rv != nil){ - if(nf != nil) + if(nf != nil) rclunk(nf); break; } @@ -827,7 +827,7 @@ readtopdir(Fid* dummy, uchar *buf, long off, int cnt, int blen) cnt -= m; } pos += m; - + for(mb = mbl; mb != nil; mb = mb->next){ mkstat(&d, mb, nil, Qmbox); m = convD2M(&d, &buf[n], blen-n); @@ -872,7 +872,7 @@ readmboxdir(Fid *f, uchar *buf, long off, int cnt, int blen) } else { msg = f->mb->root->part; pos = 0; - } + } for(; cnt > 0 && msg != nil; msg = msg->next){ /* act like deleted files aren't there */ @@ -1301,7 +1301,7 @@ struct Ignorance Ignorance *ignorance; /* - * read the file of headers to ignore + * read the file of headers to ignore */ void readignore(void) diff --git a/src/cmd/upas/fs/imap4.c b/src/cmd/upas/fs/imap4.c index 48119fa7..7fcc51b5 100644 --- a/src/cmd/upas/fs/imap4.c +++ b/src/cmd/upas/fs/imap4.c @@ -136,7 +136,7 @@ imapgrow(Imap *imap, int n) int i; if(imap->data == nil){ - imap->base = emalloc(n+1); + imap->base = emalloc(n+1); imap->data = imap->base; imap->size = n+1; } @@ -165,7 +165,7 @@ imap4resp(Imap *imap) ep = p+Blinelen(&imap->bin); while(ep > p && (ep[-1]=='\n' || ep[-1]=='\r')) *--ep = '\0'; - + if(imap->debug) fprint(2, "<- %s\n", p); strupr(p); @@ -186,7 +186,7 @@ imap4resp(Imap *imap) if(*p==' ') p++; verb = p; - + if(p = strchr(verb, ' ')) p++; else @@ -221,7 +221,7 @@ imap4resp(Imap *imap) /* <3031 bytes of data> */ /* ) */ if(strstr(p, "RFC822.SIZE") && strstr(p, "BODY[]")){ - if((q = strchr(p, '{')) + if((q = strchr(p, '{')) && (n=strtol(q+1, &en, 0), *en=='}')){ if(imap->data == nil || n >= imap->size) imapgrow(imap, n); @@ -268,7 +268,7 @@ imap4resp(Imap *imap) /* ) */ /* * 1 FETCH (UID 1 RFC822.HEADER "data") */ if(strstr(p, "RFC822.HEADER") || strstr(p, "RFC822.TEXT")){ - if((q = strchr(p, '{')) + if((q = strchr(p, '{')) && (n=strtol(q+1, &en, 0), *en=='}')){ if(imap->data == nil || n >= imap->size) imapgrow(imap, n); diff --git a/src/cmd/upas/fs/mbox.c b/src/cmd/upas/fs/mbox.c index 2f483747..b77306d6 100644 --- a/src/cmd/upas/fs/mbox.c +++ b/src/cmd/upas/fs/mbox.c @@ -721,7 +721,7 @@ ctype(Message *m, Header *h, char *p) p = skipwhite(p); p = getstring(p, m->type, 1); - + while(*p){ if(isattribute(&p, "boundary")){ s = s_new(); @@ -741,7 +741,7 @@ ctype(Message *m, Header *h, char *p) } else if(isattribute(&p, "charset")){ p = getstring(p, s_reset(m->charset), 0); } - + p = skiptosemi(p); } } @@ -1598,4 +1598,3 @@ date822tounix(char *s) *q = '\0'; return s_copy(p); } - diff --git a/src/cmd/upas/fs/pop3.c b/src/cmd/upas/fs/pop3.c index da8021dd..d41d2b48 100644 --- a/src/cmd/upas/fs/pop3.c +++ b/src/cmd/upas/fs/pop3.c @@ -506,7 +506,7 @@ pop3read(Pop *pop, Mailbox *mb, int doplumb) (Qid){PATH(mb->id, Qmbox), mb->vers, QTDIR}, nil, mb); } - return nil; + return nil; } /* */ @@ -695,4 +695,3 @@ pop3mbox(Mailbox *mb, char *path) return nil; } - diff --git a/src/cmd/upas/fs/strtotm.c b/src/cmd/upas/fs/strtotm.c index bcf0bcee..09a7914d 100644 --- a/src/cmd/upas/fs/strtotm.c +++ b/src/cmd/upas/fs/strtotm.c @@ -20,7 +20,7 @@ skipwhite(char *q) static char* months[] = { "jan", "feb", "mar", "apr", - "may", "jun", "jul", "aug", + "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" }; @@ -81,7 +81,7 @@ strtotm(char *p, Tm *tmp) continue; /* look for time zone [A-Z][A-Z]T */ - if(q-p==3 && 'A' <= p[0] && p[0] <= 'Z' + if(q-p==3 && 'A' <= p[0] && p[0] <= 'Z' && 'A' <= p[1] && p[1] <= 'Z' && p[2] == 'T'){ strecpy(tm.zone, tm.zone+4, p); continue; diff --git a/src/cmd/upas/fs/tester.c b/src/cmd/upas/fs/tester.c index 3d24012e..30c15b31 100644 --- a/src/cmd/upas/fs/tester.c +++ b/src/cmd/upas/fs/tester.c @@ -51,7 +51,7 @@ info(int indent, int mno, Message *m) info(indent+1, i++, nm); } } - + void main(int argc, char **argv) -- cgit v1.2.3