housel@en.ecn.purdue.edu (Peter S. Housel) (08/04/89)
Here are two short fixes for the recently-posted versions of expr(1) and mail(1). Thanks to Bruce Evans (evans@ditsyda.oz.au) and Nick Andrew (nick@ultima.cs.uts.oz) for finding these. -Peter S. Housel- housel@ecn.purdue.edu ...!pur-ee!housel echo 'x - expr.c.cdif' sed 's/^X//' <<'**-expr.c.cdif-EOF-**' >expr.c.cdif X*** expr.c~ Thu Aug 3 19:00:45 1989 X--- expr.c Thu Aug 3 19:00:02 1989 X*************** X*** 1,5 **** X /* file: expr.c X! * author: Peter S. Housel 7/4/89,7/7/89,7/19/89,7/20/89 X */ X X #include <stdio.h> X--- 1,5 ---- X /* file: expr.c X! * author: Peter S. Housel 7/4/89,7/7/89,7/19/89,7/20/89,08/03/89 X */ X X #include <stdio.h> X*************** X*** 219,225 **** X { X if(val1.numval == 0) X invalid("division by zero"); X! numresult(valp, valp->numval / val1.numval); X } X } X else X--- 219,225 ---- X { X if(val1.numval == 0) X invalid("division by zero"); X! numresult(valp, valp->numval % val1.numval); X } X } X else **-expr.c.cdif-EOF-** echo 'x - mail.c.cdif' sed 's/^X//' <<'**-mail.c.cdif-EOF-**' >mail.c.cdif X*** mail.c.orig Thu Aug 3 19:11:01 1989 X--- mail.c Thu Aug 3 19:13:03 1989 X*************** X*** 1,5 **** X /* file: mail.c X! ** author: Peter S. Housel 08/16/88 X */ X X #include <stdio.h> X--- 1,5 ---- X /* file: mail.c X! ** author: Peter S. Housel 08/16/88,01/06/89,08/03/89 X */ X X #include <stdio.h> X*************** X*** 675,680 **** X--- 675,682 ---- X struct letter *let; /* current letter */ X int c; X X+ sprintf(lockname, LOCKNAME, whoami()); X+ X if(NULL == (tempfp = fopen(tempname, "w"))) X { X perror("mail: can't create temporary file"); X*************** X*** 715,723 **** X X if(NULL == (boxfp = freopen(mailbox, "w", boxfp))) X { X! perror("mail: couldn't reopen maildrop\n"); X! fprintf(stderr, "mail may have been lost; look in %s\n", tempname); X! unlink(lockname); X return; X } X X--- 717,726 ---- X X if(NULL == (boxfp = freopen(mailbox, "w", boxfp))) X { X! perror("mail: couldn't reopen maildrop"); X! fprintf(stderr, "mail may have been lost; look in %s\n", tempname); X! if(usedrop) X! unlink(lockname); X return; X } X **-mail.c.cdif-EOF-**