diff options
author | Jilles Tjoelker <jilles@stack.nl> | 2010-09-08 16:17:28 +0800 |
---|---|---|
committer | maximilian attems <max@stro.at> | 2011-06-03 18:44:12 +0200 |
commit | def6933348ef565c8611e26e24cc55d438267ac4 (patch) | |
tree | a92dd35d43f8d9c5d3689b54d75e916057a25104 | |
parent | 3a8c5a94d5bcd54e7421b2e9669b66a2d05df442 (diff) | |
download | klibc-def6933348ef565c8611e26e24cc55d438267ac4.tar.gz |
[klibc] [VAR] Fix varinit ordering that broke fc
Git commit 0df96793ef6aa103df228d7dfe56099b7d721a15 "[SHELL] Add
preliminary LINENO support" added the LINENO variable in the middle of
other initialized variables, causing some macros for TERM and HISTSIZE
to break (both of these are only used if libedit support is compiled in,
which is not the case by default).
The breakage is the same as can be seen by setting HISTSIZE=0.
Also add a comment warning about this.
Reported-by: Wez Furlong <kingwez@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r-- | usr/dash/var.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr/dash/var.c b/usr/dash/var.c index 3efc9432179470..25c221667b5a96 100644 --- a/usr/dash/var.c +++ b/usr/dash/var.c @@ -78,6 +78,7 @@ const char defifsvar[] = "IFS= \t\n"; const char defifs[] = " \t\n"; #endif +/* Some macros in var.h depend on the order, add new variables to the end. */ struct var varinit[] = { #if ATTY { 0, VSTRFIXED|VTEXTFIXED|VUNSET, "ATTY\0", 0 }, @@ -94,11 +95,11 @@ struct var varinit[] = { { 0, VSTRFIXED|VTEXTFIXED, "PS2=> ", 0 }, { 0, VSTRFIXED|VTEXTFIXED, "PS4=+ ", 0 }, { 0, VSTRFIXED|VTEXTFIXED, "OPTIND=1", getoptsreset }, - { 0, VSTRFIXED|VTEXTFIXED, "LINENO=1", 0 }, #ifndef SMALL { 0, VSTRFIXED|VTEXTFIXED|VUNSET, "TERM\0", 0 }, { 0, VSTRFIXED|VTEXTFIXED|VUNSET, "HISTSIZE\0", sethistsize }, #endif + { 0, VSTRFIXED|VTEXTFIXED, "LINENO=1", 0 }, }; STATIC struct var *vartab[VTABSIZE]; |