aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-14 19:46:56 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-14 19:46:56 +0200
commit0485b677d2ccd8cd60579446cd1addcb4f322db3 (patch)
tree809370aada4b1755851270a082be111794909870
parentc2aea025bba33323b7a35dd33428277f21121251 (diff)
downloadbusybox-0485b677d2ccd8cd60579446cd1addcb4f322db3.tar.gz
ash: one "current line = 1" might be missing, fix that
I'm not sure this is necessary, but dash has this init here. Just in case, do it too. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/ash.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 1917b552c..224d77633 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -1229,6 +1229,10 @@ struct strpush {
int unget;
};
+/*
+ * The parsefile structure pointed to by the global variable parsefile
+ * contains information about the current file being read.
+ */
struct parsefile {
struct parsefile *prev; /* preceding file on stack */
int linno; /* current line */
@@ -1902,10 +1906,6 @@ nextopt(const char *optstring)
/* ============ Shell variables */
-/*
- * The parsefile structure pointed to by the global variable parsefile
- * contains information about the current file being read.
- */
struct shparam {
int nparam; /* # of positional parameters (without $0) */
#if ENABLE_ASH_GETOPTS
@@ -13603,6 +13603,7 @@ init(void)
{
/* we will never free this */
basepf.next_to_pgetc = basepf.buf = ckmalloc(IBUFSIZ);
+ basepf.linno = 1;
sigmode[SIGCHLD - 1] = S_DFL; /* ensure we install handler even if it is SIG_IGNed */
setsignal(SIGCHLD);