summaryrefslogtreecommitdiff
path: root/bin/ed/buf.c
diff options
context:
space:
mode:
authorsvn2git <svn2git@FreeBSD.org>1994-07-01 08:00:00 +0000
committersvn2git <svn2git@FreeBSD.org>1994-07-01 08:00:00 +0000
commit5e0e9b99dc3fc0ecd49d929db0d57c784b66f481 (patch)
treee779b5a6edddbb949b7990751b12d6f25304ba86 /bin/ed/buf.c
parenta16f65c7d117419bd266c28a1901ef129a337569 (diff)
Diffstat (limited to 'bin/ed/buf.c')
-rw-r--r--bin/ed/buf.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/ed/buf.c b/bin/ed/buf.c
index f5b8045ebb3b..70275990c9ae 100644
--- a/bin/ed/buf.c
+++ b/bin/ed/buf.c
@@ -26,10 +26,11 @@
* SUCH DAMAGE.
*/
#ifndef lint
-static char *rcsid = "@(#)$Id: buf.c,v 1.4 1994/02/01 00:34:35 alm Exp $";
+static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
#endif /* not lint */
#include <sys/file.h>
+#include <sys/stat.h>
#include "ed.h"
@@ -131,7 +132,7 @@ add_line_node(lp)
line_t *cp;
cp = get_addressed_line_node(current_addr); /* this get_addressed_line_node last! */
- insque(lp, cp);
+ INSQUE(lp, cp);
addr_last++;
current_addr++;
}
@@ -195,13 +196,18 @@ char sfn[15] = ""; /* scratch file name */
int
open_sbuf()
{
+ int u;
+
isbinary = newline_added = 0;
+ u = umask(077);
strcpy(sfn, "/tmp/ed.XXXXXX");
if (mktemp(sfn) == NULL || (sfp = fopen(sfn, "w+")) == NULL) {
fprintf(stderr, "%s: %s\n", sfn, strerror(errno));
sprintf(errmsg, "cannot open temp file");
+ umask(u);
return ERR;
}
+ umask(u);
return 0;
}