aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/ash.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 0cdfd2b1c..8adf581b6 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -550,6 +550,29 @@ static int parselleft; /* copy of parsefile->lleft */
550 550
551/* next character in input buffer */ 551/* next character in input buffer */
552static char *parsenextc; /* copy of parsefile->nextc */ 552static char *parsenextc; /* copy of parsefile->nextc */
553
554struct strpush {
555 struct strpush *prev; /* preceding string on stack */
556 char *prevstring;
557 int prevnleft;
558#ifdef CONFIG_ASH_ALIAS
559 struct alias *ap; /* if push was associated with an alias */
560#endif
561 char *string; /* remember the string since it may change */
562};
563
564struct parsefile {
565 struct parsefile *prev; /* preceding file on stack */
566 int linno; /* current line */
567 int fd; /* file descriptor (or -1 if string) */
568 int nleft; /* number of chars left in this line */
569 int lleft; /* number of chars left in this buffer */
570 char *nextc; /* next char in buffer */
571 char *buf; /* input buffer */
572 struct strpush *strpush; /* for pushing strings at this level */
573 struct strpush basestrpush; /* so pushing one is fast */
574};
575
553static struct parsefile basepf; /* top level input file */ 576static struct parsefile basepf; /* top level input file */
554static char basebuf[IBUFSIZ]; /* buffer for top level input file */ 577static char basebuf[IBUFSIZ]; /* buffer for top level input file */
555static struct parsefile *parsefile = &basepf; /* current input file */ 578static struct parsefile *parsefile = &basepf; /* current input file */
@@ -1573,28 +1596,6 @@ static inline int varequal(const char *a, const char *b) {
1573 1596
1574static int loopnest; /* current loop nesting level */ 1597static int loopnest; /* current loop nesting level */
1575 1598
1576struct strpush {
1577 struct strpush *prev; /* preceding string on stack */
1578 char *prevstring;
1579 int prevnleft;
1580#ifdef CONFIG_ASH_ALIAS
1581 struct alias *ap; /* if push was associated with an alias */
1582#endif
1583 char *string; /* remember the string since it may change */
1584};
1585
1586struct parsefile {
1587 struct parsefile *prev; /* preceding file on stack */
1588 int linno; /* current line */
1589 int fd; /* file descriptor (or -1 if string) */
1590 int nleft; /* number of chars left in this line */
1591 int lleft; /* number of chars left in this buffer */
1592 char *nextc; /* next char in buffer */
1593 char *buf; /* input buffer */
1594 struct strpush *strpush; /* for pushing strings at this level */
1595 struct strpush basestrpush; /* so pushing one is fast */
1596};
1597
1598/* 1599/*
1599 * The parsefile structure pointed to by the global variable parsefile 1600 * The parsefile structure pointed to by the global variable parsefile
1600 * contains information about the current file being read. 1601 * contains information about the current file being read.