search for: startstackstr

Displaying 11 results from an estimated 11 matches for "startstackstr".

2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Use PRIdMAX instead of %j in printf
...44 >> --- a/src/bltin/printf.c >> +++ b/src/bltin/printf.c >> @@ -319,11 +319,12 @@ mklong(const char *str, const char *ch) >> char *copy; >> size_t len; >> >> - len = ch - str + 3; >> + len = ch - str + 4; >> STARTSTACKSTR(copy); >> copy = makestrspace(len, copy); >> - memcpy(copy, str, len - 3); >> - copy[len - 3] = 'j'; >> + memcpy(copy, str, len - 4); >> + copy[len - 4] = 'l'; >> + copy[len - 3] = 'l'; >>...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Use PRIdMAX instead of %j in printf
...44 >> --- a/src/bltin/printf.c >> +++ b/src/bltin/printf.c >> @@ -319,11 +319,12 @@ mklong(const char *str, const char *ch) >> char *copy; >> size_t len; >> >> - len = ch - str + 3; >> + len = ch - str + 4; >> STARTSTACKSTR(copy); >> copy = makestrspace(len, copy); >> - memcpy(copy, str, len - 3); >> - copy[len - 3] = 'j'; >> + memcpy(copy, str, len - 4); >> + copy[len - 4] = 'l'; >> + copy[len - 3] = 'l'; >>...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Save/restore here-documents in command substitution
...s left from the backquote parsing - */ - popfile(); + /* Start reading from old file again. */ + popfile(); + /* Ignore any pushed back tokens left from the backquote parsing. */ + if (oldstyle) tokpushback = 0; - } while (stackblocksize() <= savelen) growstackblock(); STARTSTACKSTR(out);
2019 Jan 25
0
[klibc:update-dash] [CD] support drive letters on Cygwin
...ion that + forces normalization to the posix form */ + char pathbuf[PATH_MAX]; + if (cygwin_conv_path(CCP_WIN_A_TO_POSIX | CCP_RELATIVE, dir, pathbuf, + sizeof(pathbuf)) < 0) + sh_error("can't normalize %s", dir); + dir = pathbuf; +#endif + cdcomppath = sstrdup(dir); STARTSTACKSTR(new); if (*dir != '/') {
2020 Mar 28
0
[klibc:update-dash] dash: [CD] support drive letters on Cygwin
...ion that + forces normalization to the posix form */ + char pathbuf[PATH_MAX]; + if (cygwin_conv_path(CCP_WIN_A_TO_POSIX | CCP_RELATIVE, dir, pathbuf, + sizeof(pathbuf)) < 0) + sh_error("can't normalize %s", dir); + dir = pathbuf; +#endif + cdcomppath = sstrdup(dir); STARTSTACKSTR(new); if (*dir != '/') {
2020 Mar 28
0
[klibc:update-dash] dash: memalloc: Add growstackto helper
...b/usr/dash/parser.c index 809c6a8a..3de977c1 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -1460,9 +1460,7 @@ done: /* Ignore any pushed back tokens left from the backquote parsing. */ if (oldstyle) tokpushback = 0; - while (stackblocksize() <= savelen) - growstackblock(); - STARTSTACKSTR(out); + out = growstackto(savelen + 1); if (str) { memcpy(out, str, savelen); STADJUST(savelen, out);
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...int, int, int, int, int); STATIC char *evalvar(char *, int); static size_t strtodest(const char *p, int flags); static void memtodest(const char *p, size_t len, int flags); @@ -192,13 +192,11 @@ expandarg(union node *arg, struct arglist *arglist, int flag) argbackq = arg->narg.backquote; STARTSTACKSTR(expdest); argstr(arg->narg.text, flag); - p = _STPUTC('\0', expdest); - expdest = p - 1; if (arglist == NULL) { /* here document expanded */ goto out; } - p = grabstackstr(p); + p = grabstackstr(expdest); exparg.lastp = &exparg.list; /* * TODO - EXP_REDIR @@ -232,8...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Handle embedded NULs correctly in printf
...{ int p = getchr(); PF(start, p); @@ -227,8 +271,9 @@ err: * Halts processing string if a \c escape is encountered. */ static int -conv_escape_str(char *str) +conv_escape_str(char *str, char **sp) { + int c; int ch; char *cp; @@ -236,16 +281,14 @@ conv_escape_str(char *str) STARTSTACKSTR(cp); do { - int c; - - ch = *str++; + c = ch = *str++; if (ch != '\\') continue; ch = *str++; if (ch == 'c') { /* \c as in SYSV echo - abort all processing.... */ - ch = 0x100; + c = ch = 0x100; continue; } @@ -257,14 +300,14 @@ conv_escape_str...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Handle embedded NULs correctly in printf
...{ int p = getchr(); PF(start, p); @@ -227,8 +271,9 @@ err: * Halts processing string if a \c escape is encountered. */ static int -conv_escape_str(char *str) +conv_escape_str(char *str, char **sp) { + int c; int ch; char *cp; @@ -236,16 +281,14 @@ conv_escape_str(char *str) STARTSTACKSTR(cp); do { - int c; - - ch = *str++; + c = ch = *str++; if (ch != '\\') continue; ch = *str++; if (ch == 'c') { /* \c as in SYSV echo - abort all processing.... */ - ch = 0x100; + c = ch = 0x100; continue; } @@ -257,14 +300,14 @@ conv_escape_str...
2019 Jan 25
0
[klibc:update-dash] parser: Add syntax stack for recursive parsing
...yntax stack */ + struct synstack synbase = { .syntax = syntax }; + struct synstack *synstack = &synbase; - dblquote = 0; if (syntax == DQSYNTAX) - dblquote = 1; + synstack->dblquote = 1; quotef = 0; bqlist = NULL; - varnest = 0; - arinest = 0; - parenlevel = 0; - dqvarnest = 0; STARTSTACKSTR(out); loop: { /* for each line, until end of word */ @@ -895,7 +913,7 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) if (c == '\034' && doprompt && attyset() && ! equal(termval(), "emacs")) { attyline(); - if (syn...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Add syntax stack for recursive parsing
...yntax stack */ + struct synstack synbase = { .syntax = syntax }; + struct synstack *synstack = &synbase; - dblquote = 0; if (syntax == DQSYNTAX) - dblquote = 1; + synstack->dblquote = 1; quotef = 0; bqlist = NULL; - varnest = 0; - arinest = 0; - parenlevel = 0; - dqvarnest = 0; STARTSTACKSTR(out); loop: { /* for each line, until end of word */ @@ -895,7 +913,7 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) if (c == '\034' && doprompt && attyset() && ! equal(termval(), "emacs")) { attyline(); - if (syn...