Deleted Added
full compact
input.c (213760) input.c (213811)
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 22 unchanged lines hidden (view full) ---

31 */
32
33#ifndef lint
34#if 0
35static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95";
36#endif
37#endif /* not lint */
38#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 22 unchanged lines hidden (view full) ---

31 */
32
33#ifndef lint
34#if 0
35static char sccsid[] = "@(#)input.c 8.3 (Berkeley) 6/9/95";
36#endif
37#endif /* not lint */
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/bin/sh/input.c 213760 2010-10-13 04:01:01Z obrien $");
39__FBSDID("$FreeBSD: head/bin/sh/input.c 213811 2010-10-13 22:18:03Z obrien $");
40
41#include <stdio.h> /* defines BUFSIZ */
42#include <fcntl.h>
43#include <errno.h>
44#include <unistd.h>
45#include <stdlib.h>
46#include <string.h>
47

--- 51 unchanged lines hidden (view full) ---

99MKINIT struct parsefile basepf; /* top level input file */
100char basebuf[BUFSIZ]; /* buffer for top level input file */
101static struct parsefile *parsefile = &basepf; /* current input file */
102int init_editline = 0; /* editline library initialized? */
103int whichprompt; /* 1 == PS1, 2 == PS2 */
104
105EditLine *el; /* cookie for editline package */
106
40
41#include <stdio.h> /* defines BUFSIZ */
42#include <fcntl.h>
43#include <errno.h>
44#include <unistd.h>
45#include <stdlib.h>
46#include <string.h>
47

--- 51 unchanged lines hidden (view full) ---

99MKINIT struct parsefile basepf; /* top level input file */
100char basebuf[BUFSIZ]; /* buffer for top level input file */
101static struct parsefile *parsefile = &basepf; /* current input file */
102int init_editline = 0; /* editline library initialized? */
103int whichprompt; /* 1 == PS1, 2 == PS2 */
104
105EditLine *el; /* cookie for editline package */
106
107STATIC void pushfile(void);
108STATIC int preadfd(void);
107static void pushfile(void);
108static int preadfd(void);
109
110#ifdef mkinit
111INCLUDE "input.h"
112INCLUDE "error.h"
113
114MKINIT char basebuf[];
115
116INIT {

--- 47 unchanged lines hidden (view full) ---

164
165int
166pgetc(void)
167{
168 return pgetc_macro();
169}
170
171
109
110#ifdef mkinit
111INCLUDE "input.h"
112INCLUDE "error.h"
113
114MKINIT char basebuf[];
115
116INIT {

--- 47 unchanged lines hidden (view full) ---

164
165int
166pgetc(void)
167{
168 return pgetc_macro();
169}
170
171
172STATIC int
172static int
173preadfd(void)
174{
175 int nr;
176 parsenextc = parsefile->buf;
177
178#ifndef NO_HISTORY
179 if (el != NULL && gotwinch) {
180 gotwinch = 0;

--- 282 unchanged lines hidden (view full) ---

463
464
465
466/*
467 * To handle the "." command, a stack of input files is used. Pushfile
468 * adds a new entry to the stack and popfile restores the previous level.
469 */
470
173preadfd(void)
174{
175 int nr;
176 parsenextc = parsefile->buf;
177
178#ifndef NO_HISTORY
179 if (el != NULL && gotwinch) {
180 gotwinch = 0;

--- 282 unchanged lines hidden (view full) ---

463
464
465
466/*
467 * To handle the "." command, a stack of input files is used. Pushfile
468 * adds a new entry to the stack and popfile restores the previous level.
469 */
470
471STATIC void
471static void
472pushfile(void)
473{
474 struct parsefile *pf;
475
476 parsefile->nleft = parsenleft;
477 parsefile->lleft = parselleft;
478 parsefile->nextc = parsenextc;
479 parsefile->linno = plinno;

--- 84 unchanged lines hidden ---
472pushfile(void)
473{
474 struct parsefile *pf;
475
476 parsefile->nleft = parsenleft;
477 parsefile->lleft = parselleft;
478 parsefile->nextc = parsenextc;
479 parsefile->linno = plinno;

--- 84 unchanged lines hidden ---