Deleted Added
full compact
parser.c (104554) parser.c (117261)
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

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

35 */
36
37#ifndef lint
38#if 0
39static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
40#endif
41#endif /* not lint */
42#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

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

35 */
36
37#ifndef lint
38#if 0
39static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
40#endif
41#endif /* not lint */
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/bin/sh/parser.c 104554 2002-10-06 06:35:51Z tjr $");
43__FBSDID("$FreeBSD: head/bin/sh/parser.c 117261 2003-07-05 15:18:44Z dds $");
44
45#include <stdlib.h>
46
47#include "shell.h"
48#include "parser.h"
49#include "nodes.h"
50#include "expand.h" /* defines rmescapes() */
51#include "redir.h" /* defines copyfd() */

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

79 struct heredoc *next; /* next here document in list */
80 union node *here; /* redirection node */
81 char *eofmark; /* string indicating end of input */
82 int striptabs; /* if set, strip leading tabs */
83};
84
85
86
44
45#include <stdlib.h>
46
47#include "shell.h"
48#include "parser.h"
49#include "nodes.h"
50#include "expand.h" /* defines rmescapes() */
51#include "redir.h" /* defines copyfd() */

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

79 struct heredoc *next; /* next here document in list */
80 union node *here; /* redirection node */
81 char *eofmark; /* string indicating end of input */
82 int striptabs; /* if set, strip leading tabs */
83};
84
85
86
87struct heredoc *heredoclist; /* list of here documents to read */
88int parsebackquote; /* nonzero if we are inside backquotes */
89int doprompt; /* if set, prompt the user */
90int needprompt; /* true if interactive and at start of line */
91int lasttoken; /* last token read */
87STATIC struct heredoc *heredoclist; /* list of here documents to read */
88STATIC int parsebackquote; /* nonzero if we are inside backquotes */
89STATIC int doprompt; /* if set, prompt the user */
90STATIC int needprompt; /* true if interactive and at start of line */
91STATIC int lasttoken; /* last token read */
92MKINIT int tokpushback; /* last token pushed back */
92MKINIT int tokpushback; /* last token pushed back */
93char *wordtext; /* text of last word returned by readtoken */
93STATIC char *wordtext; /* text of last word returned by readtoken */
94MKINIT int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */
94MKINIT int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */
95struct nodelist *backquotelist;
96union node *redirnode;
97struct heredoc *heredoc;
98int quoteflag; /* set if (part of) last token was quoted */
99int startlinno; /* line # where last token started */
95STATIC struct nodelist *backquotelist;
96STATIC union node *redirnode;
97STATIC struct heredoc *heredoc;
98STATIC int quoteflag; /* set if (part of) last token was quoted */
99STATIC int startlinno; /* line # where last token started */
100
101/* XXX When 'noaliases' is set to one, no alias expansion takes place. */
102static int noaliases = 0;
103
104#define GDB_HACK 1 /* avoid local declarations which gdb can't handle */
105#ifdef GDB_HACK
106static const char argvars[5] = {CTLVAR, VSNORMAL|VSQUOTE, '@', '=', '\0'};
107static const char types[] = "}-+?=";

--- 1473 unchanged lines hidden ---
100
101/* XXX When 'noaliases' is set to one, no alias expansion takes place. */
102static int noaliases = 0;
103
104#define GDB_HACK 1 /* avoid local declarations which gdb can't handle */
105#ifdef GDB_HACK
106static const char argvars[5] = {CTLVAR, VSNORMAL|VSQUOTE, '@', '=', '\0'};
107static const char types[] = "}-+?=";

--- 1473 unchanged lines hidden ---