Displaying 9 results from an estimated 9 matches for "pushstackmark".
2019 Jan 25
0
[klibc:update-dash] input: Fix here-document redirection with vi/emacs on
...nd output to see. Nice find.
The problem is that getprompt() is implicitly called by el_gets(). This
messes with the memory used by the parser to store the here-document's
contents. In the non-emacs/vi case, the prompt is explicitly written by
setprompt(), which wraps the getprompt() call in a
pushstackmark()/popstackmark() pair to restore the state so that parsing
can continue. But when getprompt() is called by el_gets(), it knows
nothing about this.
The whole call to el_gets() can be surrounded by another
pushstackmark()/popstackmark() pair to solve the problem, as attached.
Cheers,
Harald van Dij...
2020 Mar 28
0
[klibc:update-dash] dash: input: Fix here-document redirection with vi/emacs on
...nd output to see. Nice find.
The problem is that getprompt() is implicitly called by el_gets(). This
messes with the memory used by the parser to store the here-document's
contents. In the non-emacs/vi case, the prompt is explicitly written by
setprompt(), which wraps the getprompt() call in a
pushstackmark()/popstackmark() pair to restore the state so that parsing
can continue. But when getprompt() is called by el_gets(), it knows
nothing about this.
The whole call to el_gets() can be surrounded by another
pushstackmark()/popstackmark() pair to solve the problem, as attached.
Cheers,
Harald van Dij...
2011 Nov 30
1
[PATCH] [MEMALLOC] remove unused variable
Since commit 6ee30a14afac681adb1d62361ebcb0c9b6ba3153 ([klibc]
[MEMALLOC] Add pushstackmark), the 'oldstackp' local variable has been
unused. This change deletes the unused variable.
Signed-off-by: Greg Thelen <gthelen at google.com>
---
usr/dash/memalloc.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/usr/dash/memalloc.c b/usr/dash/memalloc.c...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...m;
- char *p, *start;
int begoff;
+ int endoff;
int len;
intmax_t result;
+ char *p;
- /* ifsfree(); */
-
- /*
- * This routine is slightly over-complicated for
- * efficiency. Next we scan backwards looking for the
- * start of arithmetic.
- */
- start = stackblock();
- p = expdest;
- pushstackmark(&sm, p - start);
- *--p = '\0';
- p--;
- do {
- int esc;
-
- while (*p != (char)CTLARI) {
- p--;
-#ifdef DEBUG
- if (p < start) {
- sh_error("missing CTLARI (shouldn't happen)");
- }
-#endif
- }
-
- esc = esclen(start, p);
- if (!(esc % 2)) {
- break;
-...
2020 Mar 28
0
[klibc:update-dash] dash: memalloc: Avoid looping in growstackto
...en)
- growstackblock();
-
+ if (stackblocksize() < len)
+ growstackblock(len);
return stackblock();
}
diff --git a/usr/dash/memalloc.h b/usr/dash/memalloc.h
index b348d9cc..b9c63dac 100644
--- a/usr/dash/memalloc.h
+++ b/usr/dash/memalloc.h
@@ -55,7 +55,6 @@ void stunalloc(pointer);
void pushstackmark(struct stackmark *mark, size_t len);
void setstackmark(struct stackmark *);
void popstackmark(struct stackmark *);
-void growstackblock(void);
void *growstackstr(void);
char *growstackto(size_t len);
char *makestrspace(size_t, char *);
2010 Mar 22
1
[git pull] dash, sh4, README's
...un-time
[klibc] [PARSER] Recognise here-doc delimiters terminated by EOF
[klibc] [PARSER] Fix parsing of ${##1}
[klibc] [PARSER] Size optimisations in parameter expansion parser
[klibc] [MEMALLOC] Made grabstackblock an inline wrapper for stalloc
[klibc] [MEMALLOC] Add pushstackmark
[klibc] [BUILTIN] Treat OPTIND=0 in the same way as OPTIND=1
[klibc] [VAR] Remove setvarsafe
[klibc] [BUILTIN] Use intmax_t arithmetic in test
[klibc] [PARSER] Report substition errors at expansion time
[klibc] [ARITH] Add assignment and intmax_t support
[klibc]...
2010 Apr 16
0
[git pull v4] dash, sh4, ipconfig, dprintf, fstype, README's
...un-time
[klibc] [PARSER] Recognise here-doc delimiters terminated by EOF
[klibc] [PARSER] Fix parsing of ${##1}
[klibc] [PARSER] Size optimisations in parameter expansion parser
[klibc] [MEMALLOC] Made grabstackblock an inline wrapper for stalloc
[klibc] [MEMALLOC] Add pushstackmark
[klibc] [BUILTIN] Treat OPTIND=0 in the same way as OPTIND=1
[klibc] [VAR] Remove setvarsafe
[klibc] [BUILTIN] Use intmax_t arithmetic in test
[klibc] [PARSER] Report substition errors at expansion time
[klibc] [ARITH] Add assignment and intmax_t support
[klibc]...
2010 Apr 16
0
[PATCH] pull faccessat() system call
...un-time
[klibc] [PARSER] Recognise here-doc delimiters terminated by EOF
[klibc] [PARSER] Fix parsing of ${##1}
[klibc] [PARSER] Size optimisations in parameter expansion parser
[klibc] [MEMALLOC] Made grabstackblock an inline wrapper for stalloc
[klibc] [MEMALLOC] Add pushstackmark
[klibc] [BUILTIN] Treat OPTIND=0 in the same way as OPTIND=1
[klibc] [VAR] Remove setvarsafe
[klibc] [BUILTIN] Use intmax_t arithmetic in test
[klibc] [PARSER] Report substition errors at expansion time
[klibc] [ARITH] Add assignment and intmax_t support
[klibc]...
2010 Mar 28
1
[git pull v3] dash, sh4, ipconfig, dprintf, fstype, README's
...un-time
[klibc] [PARSER] Recognise here-doc delimiters terminated by EOF
[klibc] [PARSER] Fix parsing of ${##1}
[klibc] [PARSER] Size optimisations in parameter expansion parser
[klibc] [MEMALLOC] Made grabstackblock an inline wrapper for stalloc
[klibc] [MEMALLOC] Add pushstackmark
[klibc] [BUILTIN] Treat OPTIND=0 in the same way as OPTIND=1
[klibc] [VAR] Remove setvarsafe
[klibc] [BUILTIN] Use intmax_t arithmetic in test
[klibc] [PARSER] Report substition errors at expansion time
[klibc] [ARITH] Add assignment and intmax_t support
[klibc]...