=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mail/edit.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/mail/edit.c 1996/06/11 12:53:38 1.2 --- src/usr.bin/mail/edit.c 1997/07/13 21:21:11 1.3 *************** *** 1,4 **** ! /* $OpenBSD: edit.c,v 1.2 1996/06/11 12:53:38 deraadt Exp $ */ /* $NetBSD: edit.c,v 1.5 1996/06/08 19:48:20 christos Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: edit.c,v 1.3 1997/07/13 21:21:11 millert Exp $ */ /* $NetBSD: edit.c,v 1.5 1996/06/08 19:48:20 christos Exp $ */ /* *************** *** 38,44 **** #if 0 static char sccsid[] = "@(#)edit.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: edit.c,v 1.2 1996/06/11 12:53:38 deraadt Exp $"; #endif #endif /* not lint */ --- 38,44 ---- #if 0 static char sccsid[] = "@(#)edit.c 8.1 (Berkeley) 6/6/93"; #else ! static char rcsid[] = "$OpenBSD: edit.c,v 1.3 1997/07/13 21:21:11 millert Exp $"; #endif #endif /* not lint */ *************** *** 61,67 **** { int *msgvec = v; ! return edit1(msgvec, 'e'); } /* --- 61,67 ---- { int *msgvec = v; ! return(edit1(msgvec, 'e')); } /* *************** *** 73,79 **** { int *msgvec = v; ! return edit1(msgvec, 'v'); } /* --- 73,79 ---- { int *msgvec = v; ! return(edit1(msgvec, 'v')); } /* *************** *** 103,109 **** char *p; printf("Edit message %d [ynq]? ", msgvec[i]); ! if (fgets(buf, sizeof buf, stdin) == 0) break; for (p = buf; *p == ' ' || *p == '\t'; p++) ; --- 103,109 ---- char *p; printf("Edit message %d [ynq]? ", msgvec[i]); ! if (fgets(buf, sizeof(buf), stdin) == 0) break; for (p = buf; *p == ' ' || *p == '\t'; p++) ; *************** *** 132,143 **** break; } if (ferror(otf)) ! perror("/tmp"); ! (void) Fclose(fp); } (void) signal(SIGINT, sigint); } ! return 0; } /* --- 132,143 ---- break; } if (ferror(otf)) ! warn("/tmp"); ! (void)Fclose(fp); } (void) signal(SIGINT, sigint); } ! return(0); } /* *************** *** 160,170 **** extern char *tempEdit; if ((t = creat(tempEdit, readonly ? 0400 : 0600)) < 0) { ! perror(tempEdit); goto out; } if ((nf = Fdopen(t, "w")) == NULL) { ! perror(tempEdit); (void) unlink(tempEdit); goto out; } --- 160,170 ---- extern char *tempEdit; if ((t = creat(tempEdit, readonly ? 0400 : 0600)) < 0) { ! warn(tempEdit); goto out; } if ((nf = Fdopen(t, "w")) == NULL) { ! warn(tempEdit); (void) unlink(tempEdit); goto out; } *************** *** 181,193 **** modtime = statb.st_mtime; if (ferror(nf)) { (void) Fclose(nf); ! perror(tempEdit); (void) unlink(tempEdit); nf = NULL; goto out; } if (Fclose(nf) < 0) { ! perror(tempEdit); (void) unlink(tempEdit); nf = NULL; goto out; --- 181,193 ---- modtime = statb.st_mtime; if (ferror(nf)) { (void) Fclose(nf); ! warn(tempEdit); (void) unlink(tempEdit); nf = NULL; goto out; } if (Fclose(nf) < 0) { ! warn(tempEdit); (void) unlink(tempEdit); nf = NULL; goto out; *************** *** 208,214 **** goto out; } if (stat(tempEdit, &statb) < 0) { ! perror(tempEdit); goto out; } if (modtime == statb.st_mtime) { --- 208,214 ---- goto out; } if (stat(tempEdit, &statb) < 0) { ! warn(tempEdit); goto out; } if (modtime == statb.st_mtime) { *************** *** 219,229 **** * Now switch to new file. */ if ((nf = Fopen(tempEdit, "a+")) == NULL) { ! perror(tempEdit); (void) unlink(tempEdit); goto out; } (void) unlink(tempEdit); out: ! return nf; } --- 219,229 ---- * Now switch to new file. */ if ((nf = Fopen(tempEdit, "a+")) == NULL) { ! warn(tempEdit); (void) unlink(tempEdit); goto out; } (void) unlink(tempEdit); out: ! return(nf); }