Displaying 8 results from an estimated 8 matches for "vtextfixed".
2019 Jan 25
0
[klibc:update-dash] [VAR] Use setvareq to set OPTIND initially
...uot;IFS= \t\n";
#else
const char defifs[] = " \t\n";
#endif
+MKINIT char defoptindvar[] = "OPTIND=1";
int lineno;
char linenovar[sizeof("LINENO=")+sizeof(int)*CHAR_BIT/3+1] = "LINENO=";
@@ -100,7 +101,7 @@ struct var varinit[] = {
{ 0, VSTRFIXED|VTEXTFIXED, "PS1=$ ", 0 },
{ 0, VSTRFIXED|VTEXTFIXED, "PS2=> ", 0 },
{ 0, VSTRFIXED|VTEXTFIXED, "PS4=+ ", 0 },
- { 0, VSTRFIXED|VTEXTFIXED, "OPTIND=1", getoptsreset },
+ { 0, VSTRFIXED|VTEXTFIXED, defoptindvar, getoptsreset },
#ifdef WITH_LINENO
{ 0, VSTR...
2020 Mar 28
0
[klibc:update-dash] dash: [VAR] Use setvareq to set OPTIND initially
...uot;IFS= \t\n";
#else
const char defifs[] = " \t\n";
#endif
+MKINIT char defoptindvar[] = "OPTIND=1";
int lineno;
char linenovar[sizeof("LINENO=")+sizeof(int)*CHAR_BIT/3+1] = "LINENO=";
@@ -100,7 +101,7 @@ struct var varinit[] = {
{ 0, VSTRFIXED|VTEXTFIXED, "PS1=$ ", 0 },
{ 0, VSTRFIXED|VTEXTFIXED, "PS2=> ", 0 },
{ 0, VSTRFIXED|VTEXTFIXED, "PS4=+ ", 0 },
- { 0, VSTRFIXED|VTEXTFIXED, "OPTIND=1", getoptsreset },
+ { 0, VSTRFIXED|VTEXTFIXED, defoptindvar, getoptsreset },
#ifdef WITH_LINENO
{ 0, VSTR...
2020 Mar 28
0
[klibc:update-dash] dash: var: Set IFS to fixed value at start time
...f IFS_BROKEN
-const char defifsvar[] = "IFS= \t\n";
-#else
-const char defifs[] = " \t\n";
-#endif
+char defifsvar[] = "IFS= \t\n";
MKINIT char defoptindvar[] = "OPTIND=1";
int lineno;
@@ -90,11 +86,7 @@ struct var varinit[] = {
#if ATTY
{ 0, VSTRFIXED|VTEXTFIXED|VUNSET, "ATTY\0", 0 },
#endif
-#ifdef IFS_BROKEN
{ 0, VSTRFIXED|VTEXTFIXED, defifsvar, 0 },
-#else
- { 0, VSTRFIXED|VTEXTFIXED|VUNSET, "IFS\0", 0 },
-#endif
{ 0, VSTRFIXED|VTEXTFIXED|VUNSET, "MAIL\0", changemail },
{ 0, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPA...
2012 Jul 02
0
[klibc:master] [SHELL] Allow building without LINEO support
...t>
---
usr/dash/var.c | 4 ++++
usr/dash/var.h | 6 ++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/usr/dash/var.c b/usr/dash/var.c
index ecc8c90..027beff 100644
--- a/usr/dash/var.c
+++ b/usr/dash/var.c
@@ -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...
2019 Jan 25
0
[klibc:update-dash] [VAR] Initialise OPTIND after importing environment
...ertions(+)
diff --git a/usr/dash/var.c b/usr/dash/var.c
index c35e925e..fa248544 100644
--- a/usr/dash/var.c
+++ b/usr/dash/var.c
@@ -142,6 +142,8 @@ INIT {
}
}
+ setvarint("OPTIND", 1, 0);
+
fmtstr(ppid + 5, sizeof(ppid) - 5, "%ld", (long) getppid());
setvareq(ppid, VTEXTFIXED);
2020 Mar 28
0
[klibc:update-dash] dash: [VAR] Initialise OPTIND after importing environment
...ertions(+)
diff --git a/usr/dash/var.c b/usr/dash/var.c
index c35e925e..fa248544 100644
--- a/usr/dash/var.c
+++ b/usr/dash/var.c
@@ -142,6 +142,8 @@ INIT {
}
}
+ setvarint("OPTIND", 1, 0);
+
fmtstr(ppid + 5, sizeof(ppid) - 5, "%ld", (long) getppid());
setvareq(ppid, VTEXTFIXED);
2012 Jul 02
0
[klibc:master] [VAR] Sanitise environment variable names on entry
...r.c
index 027beff..dc90249 100644
--- a/usr/dash/var.c
+++ b/usr/dash/var.c
@@ -136,7 +136,8 @@ INIT {
initvar();
for (envp = environ ; *envp ; envp++) {
- if (strchr(*envp, '=')) {
+ p = endofname(*envp);
+ if (p != *envp && *p == '=') {
setvareq(*envp, VEXPORT|VTEXTFIXED);
}
}
2020 Mar 28
0
[klibc:update-dash] dash: eval: Replace with listsetvar with mklocal/setvareq
...q(name, VSTRFIXED);
+ vp = setvareq(name, VSTRFIXED | flags);
else
- vp = setvar(name, NULL, VSTRFIXED);
+ vp = setvar(name, NULL, VSTRFIXED | flags);
lvp->flags = VUNSET;
} else {
lvp->text = vp->text;
lvp->flags = vp->flags;
vp->flags |= VSTRFIXED|VTEXTFIXED;
if (eq)
- setvareq(name, 0);
+ setvareq(name, flags);
}
}
lvp->vp = vp;
diff --git a/usr/dash/var.h b/usr/dash/var.h
index 52f559d1..8759be46 100644
--- a/usr/dash/var.h
+++ b/usr/dash/var.h
@@ -139,7 +139,6 @@ struct var *setvar(const char *name, const char *val, int flags);...