Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
[klibc] [SHELL] Allow building without LINEO support
Browse files Browse the repository at this point in the history
Simply specify --disable-lineno to configure.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: maximilian attems <max@stro.at>
  • Loading branch information
davem330 authored and brainflux committed Jul 2, 2012
1 parent 4a12ba8 commit 4a84d61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions usr/dash/var.c
Expand Up @@ -101,7 +101,9 @@ struct var varinit[] = {
{ 0, VSTRFIXED|VTEXTFIXED, "PS2=> ", 0 },
{ 0, VSTRFIXED|VTEXTFIXED, "PS4=+ ", 0 },
{ 0, VSTRFIXED|VTEXTFIXED, "OPTIND=1", getoptsreset },
#ifdef WITH_LINENO
{ 0, VSTRFIXED|VTEXTFIXED, linenovar, 0 },
#endif
#ifndef SMALL
{ 0, VSTRFIXED|VTEXTFIXED|VUNSET, "TERM\0", 0 },
{ 0, VSTRFIXED|VTEXTFIXED|VUNSET, "HISTSIZE\0", sethistsize },
Expand Down Expand Up @@ -335,9 +337,11 @@ lookupvar(const char *name)
struct var *v;

if ((v = *findvar(hashvar(name), name)) && !(v->flags & VUNSET)) {
#ifdef WITH_LINENO
if (v == &vlineno && v->text == linenovar) {
fmtstr(linenovar+7, sizeof(linenovar)-7, "%d", lineno);
}
#endif
return strchrnul(v->text, '=') + 1;
}
return NULL;
Expand Down
6 changes: 6 additions & 0 deletions usr/dash/var.h
Expand Up @@ -88,9 +88,15 @@ extern struct var varinit[];
#define vps2 (&vps1)[1]
#define vps4 (&vps2)[1]
#define voptind (&vps4)[1]
#ifdef WITH_LINENO
#define vlineno (&voptind)[1]
#endif
#ifndef SMALL
#ifdef WITH_LINENO
#define vterm (&vlineno)[1]
#else
#define vterm (&voptind)[1]
#endif
#define vhistsize (&vterm)[1]
#endif

Expand Down

0 comments on commit 4a84d61

Please sign in to comment.