summaryrefslogtreecommitdiffstats
path: root/bin/sh/input.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-09-01 10:22:36 +0000
committerpeter <peter@FreeBSD.org>1996-09-01 10:22:36 +0000
commit5195be912eb257c05a0c97e561e72f01af2583ff (patch)
treee47ab3981b495c675a987dd1e943d1f4c823f314 /bin/sh/input.c
parent2fc7d7d1fa299368ccdddede67b31695266698bd (diff)
downloadFreeBSD-src-5195be912eb257c05a0c97e561e72f01af2583ff.zip
FreeBSD-src-5195be912eb257c05a0c97e561e72f01af2583ff.tar.gz
Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is a
merge of parallel duplicate work by Steve Price and myself. :-] There are some changes to the build that are my fault... mkinit.c was trying (poorly) to duplicate some of the work that make(1) is designed to do. The Makefile hackery is my fault too, the depend list was incomplete because of some explicit OBJS+= entries, so mkdep wasn't picking up their source file #includes. This closes a pile of /bin/sh PR's, but not all of them.. Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter
Diffstat (limited to 'bin/sh/input.c')
-rw-r--r--bin/sh/input.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/bin/sh/input.c b/bin/sh/input.c
index 80c26ef..1d41bb2 100644
--- a/bin/sh/input.c
+++ b/bin/sh/input.c
@@ -33,21 +33,26 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: input.c,v 1.3 1995/05/30 00:07:15 rgrimes Exp $
+ * $Id: input.c,v 1.4 1995/11/03 18:50:14 peter Exp $
*/
#ifndef lint
-static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93";
+static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95";
#endif /* not lint */
+#include <stdio.h> /* defines BUFSIZ */
+#include <fcntl.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
/*
* This file implements the input routines used by the parser.
*/
-#include <stdio.h> /* defines BUFSIZ */
#include "shell.h"
-#include <fcntl.h>
-#include <errno.h>
+#include "redir.h"
#include "syntax.h"
#include "input.h"
#include "output.h"
@@ -100,13 +105,7 @@ int whichprompt; /* 1 == PS1, 2 == PS2 */
EditLine *el; /* cookie for editline package */
-#ifdef __STDC__
-STATIC void pushfile(void);
-#else
-STATIC void pushfile();
-#endif
-
-
+STATIC void pushfile __P((void));
#ifdef mkinit
INCLUDE "input.h"
@@ -137,7 +136,8 @@ SHELLPROC {
char *
pfgets(line, len)
char *line;
- {
+ int len;
+{
register char *p = line;
int nleft = len;
int c;
@@ -346,6 +346,7 @@ pushstring(s, len, ap)
INTON;
}
+void
popstring()
{
struct strpush *sp = parsefile->strpush;
@@ -371,7 +372,8 @@ popstring()
void
setinputfile(fname, push)
char *fname;
- {
+ int push;
+{
int fd;
int fd2;
@@ -396,7 +398,9 @@ setinputfile(fname, push)
*/
void
-setinputfd(fd, push) {
+setinputfd(fd, push)
+ int fd, push;
+{
if (push) {
pushfile();
parsefile->buf = ckmalloc(BUFSIZ);
@@ -418,6 +422,7 @@ setinputfd(fd, push) {
void
setinputstring(string, push)
char *string;
+ int push;
{
INTOFF;
if (push)
OpenPOWER on IntegriCloud