Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/sed Close files opened at processing time within pro...
details: https://anonhg.NetBSD.org/src/rev/910845cf1ab2
branches: trunk
changeset: 336426:910845cf1ab2
user: asau <asau%NetBSD.org@localhost>
date: Sun Mar 01 01:00:07 2015 +0000
description:
Close files opened at processing time within processing phase.
diffstat:
usr.bin/sed/extern.h | 3 +--
usr.bin/sed/main.c | 5 ++---
usr.bin/sed/process.c | 8 +++++---
3 files changed, 8 insertions(+), 8 deletions(-)
diffs (86 lines):
diff -r 7f621b35429e -r 910845cf1ab2 usr.bin/sed/extern.h
--- a/usr.bin/sed/extern.h Sun Mar 01 00:51:08 2015 +0000
+++ b/usr.bin/sed/extern.h Sun Mar 01 01:00:07 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.17 2015/03/01 00:51:08 asau Exp $ */
+/* $NetBSD: extern.h,v 1.18 2015/03/01 01:00:07 asau Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -62,7 +62,6 @@
extern int ispan;
extern int rflags; /* regex flags to use */
-void cfclose(struct s_command *, struct s_command *);
void compile(void);
void cspace(SPACE *, const char *, size_t, enum e_spflag);
int process(void);
diff -r 7f621b35429e -r 910845cf1ab2 usr.bin/sed/main.c
--- a/usr.bin/sed/main.c Sun Mar 01 00:51:08 2015 +0000
+++ b/usr.bin/sed/main.c Sun Mar 01 01:00:07 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.32 2015/03/01 00:38:01 asau Exp $ */
+/* $NetBSD: main.c,v 1.33 2015/03/01 01:00:07 asau Exp $ */
/*-
* Copyright (c) 2013 Johann 'Myrkraverk' Oskarsson.
@@ -39,7 +39,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: main.c,v 1.32 2015/03/01 00:38:01 asau Exp $");
+__RCSID("$NetBSD: main.c,v 1.33 2015/03/01 01:00:07 asau Exp $");
#ifdef __FBSDID
__FBSDID("$FreeBSD: head/usr.bin/sed/main.c 252231 2013-06-26 04:14:19Z pfg $");
#endif
@@ -185,7 +185,6 @@
else
add_file(NULL);
rval = process();
- cfclose(prog, NULL);
if (fclose(stdout))
err(1, "stdout");
exit(rval);
diff -r 7f621b35429e -r 910845cf1ab2 usr.bin/sed/process.c
--- a/usr.bin/sed/process.c Sun Mar 01 00:51:08 2015 +0000
+++ b/usr.bin/sed/process.c Sun Mar 01 01:00:07 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: process.c,v 1.49 2015/03/01 00:51:08 asau Exp $ */
+/* $NetBSD: process.c,v 1.50 2015/03/01 01:00:07 asau Exp $ */
/*-
* Copyright (c) 1992 Diomidis Spinellis.
@@ -38,7 +38,7 @@
#endif
#include <sys/cdefs.h>
-__RCSID("$NetBSD: process.c,v 1.49 2015/03/01 00:51:08 asau Exp $");
+__RCSID("$NetBSD: process.c,v 1.50 2015/03/01 01:00:07 asau Exp $");
#ifdef __FBSDID
__FBSDID("$FreeBSD: head/usr.bin/sed/process.c 192732 2009-05-25 06:45:33Z brian $");
#endif
@@ -80,6 +80,7 @@
static int lastline(void);
static __inline int applies(struct s_command *);
+static void cfclose(struct s_command *, struct s_command *);
static void do_tr(struct s_tr *);
static void flush_appends(void);
static void lputs(char *, size_t);
@@ -296,6 +297,7 @@
OUT();
flush_appends();
} /* for all lines */
+ cfclose(prog, NULL);
return rval;
}
@@ -795,7 +797,7 @@
/*
* Close all cached opened files and report any errors
*/
-void
+static void
cfclose(struct s_command *cp, struct s_command *end)
{
Home |
Main Index |
Thread Index |
Old Index