Displaying 9 results from an estimated 9 matches for "defif".
Did you mean:
defi
2020 Mar 28
0
[klibc:update-dash] dash: var: Set IFS to fixed value at start time
...r.c b/usr/dash/var.c
index cc6f7f2a..604ab1f7 100644
--- a/usr/dash/var.c
+++ b/usr/dash/var.c
@@ -75,11 +75,7 @@ MKINIT struct localvar_list *localvar_stack;
const char defpathvar[] =
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
-#ifdef 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\...
2019 Jan 25
0
[klibc:update-dash] builtin: Fix handling of trailing IFS white spaces
...har *q;
+ char *r = NULL;
const char *ifs, *realifs;
int ifsspc;
int nulonly;
@@ -1042,16 +1046,76 @@ ifsbreakup(char *string, struct arglist *arglist)
ifs = nulonly ? nullstr : realifs;
ifsspc = 0;
while (p < string + ifsp->endoff) {
+ int c;
+ bool isifs;
+ bool isdefifs;
+
q = p;
- if (*p == (char)CTLESC)
- p++;
- if (strchr(ifs, *p)) {
+ c = *p++;
+ if (c == (char)CTLESC)
+ c = *p++;
+
+ isifs = strchr(ifs, c);
+ isdefifs = false;
+ if (isifs)
+ isdefifs = strchr(defifs, c);
+
+ /* If only reading one more argument:
+...
2020 Mar 28
0
[klibc:update-dash] dash: builtin: Fix handling of trailing IFS white spaces
...har *q;
+ char *r = NULL;
const char *ifs, *realifs;
int ifsspc;
int nulonly;
@@ -1042,16 +1046,76 @@ ifsbreakup(char *string, struct arglist *arglist)
ifs = nulonly ? nullstr : realifs;
ifsspc = 0;
while (p < string + ifsp->endoff) {
+ int c;
+ bool isifs;
+ bool isdefifs;
+
q = p;
- if (*p == (char)CTLESC)
- p++;
- if (strchr(ifs, *p)) {
+ c = *p++;
+ if (c == (char)CTLESC)
+ c = *p++;
+
+ isifs = strchr(ifs, c);
+ isdefifs = false;
+ if (isifs)
+ isdefifs = strchr(defifs, c);
+
+ /* If only reading one more argument:
+...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Set command -p path to /usr/sbin:/usr/bin:/sbin:/bin
...au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/var.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/dash/var.h b/usr/dash/var.h
index 1a06a3cb..11ce9b7d 100644
--- a/usr/dash/var.h
+++ b/usr/dash/var.h
@@ -107,7 +107,7 @@ extern const char defifsvar[];
extern const char defifs[];
#endif
extern const char defpathvar[];
-#define defpath (defpathvar + 5)
+#define defpath (defpathvar + 36)
extern int lineno;
extern char linenovar[];
2019 Jan 25
0
[klibc:update-dash] [VAR] Use setvareq to set OPTIND initially
...org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/var.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/usr/dash/var.c b/usr/dash/var.c
index fa248544..cc6f7f2a 100644
--- a/usr/dash/var.c
+++ b/usr/dash/var.c
@@ -80,6 +80,7 @@ const char defifsvar[] = "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,...
2019 Jan 25
0
[klibc:update-dash] expand: Fix bugs with words connected to the right of $@
...DOLATSTRLEN - 1)) {
+ p = evalvar(p + 1, flag | EXP_QUOTED) + 1;
goto start;
}
+ inquotes ^= EXP_QUOTED;
addquote:
if (flag & QUOTES_ESC) {
p--;
@@ -1032,7 +1032,10 @@ ifsbreakup(char *string, int maxargs, struct arglist *arglist)
realifs = ifsset() ? ifsval() : defifs;
ifsp = &ifsfirst;
do {
+ int afternul;
+
p = string + ifsp->begoff;
+ afternul = nulonly;
nulonly = ifsp->nulonly;
ifs = nulonly ? nullstr : realifs;
ifsspc = 0;
@@ -1097,7 +1100,7 @@ ifsbreakup(char *string, int maxargs, struct arglist *arglist)
}...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Set command -p path to /usr/sbin:/usr/bin:/sbin:/bin
...au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/var.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/dash/var.h b/usr/dash/var.h
index 1a06a3cb..11ce9b7d 100644
--- a/usr/dash/var.h
+++ b/usr/dash/var.h
@@ -107,7 +107,7 @@ extern const char defifsvar[];
extern const char defifs[];
#endif
extern const char defpathvar[];
-#define defpath (defpathvar + 5)
+#define defpath (defpathvar + 36)
extern int lineno;
extern char linenovar[];
2020 Mar 28
0
[klibc:update-dash] dash: [VAR] Use setvareq to set OPTIND initially
...org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/var.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/usr/dash/var.c b/usr/dash/var.c
index fa248544..cc6f7f2a 100644
--- a/usr/dash/var.c
+++ b/usr/dash/var.c
@@ -80,6 +80,7 @@ const char defifsvar[] = "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,...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix bugs with words connected to the right of $@
...DOLATSTRLEN - 1)) {
+ p = evalvar(p + 1, flag | EXP_QUOTED) + 1;
goto start;
}
+ inquotes ^= EXP_QUOTED;
addquote:
if (flag & QUOTES_ESC) {
p--;
@@ -1032,7 +1032,10 @@ ifsbreakup(char *string, int maxargs, struct arglist *arglist)
realifs = ifsset() ? ifsval() : defifs;
ifsp = &ifsfirst;
do {
+ int afternul;
+
p = string + ifsp->begoff;
+ afternul = nulonly;
nulonly = ifsp->nulonly;
ifs = nulonly ? nullstr : realifs;
ifsspc = 0;
@@ -1097,7 +1100,7 @@ ifsbreakup(char *string, int maxargs, struct arglist *arglist)
}...