search for: bltin

Displaying 20 results from an estimated 65 matches for "bltin".

Did you mean: blin
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Use PRIdMAX instead of %j in printf
...mmitDate: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] [BUILTIN] Use PRIdMAX instead of %j in printf On 12/03/2012 05:59 PM, Harald van Dijk wrote: > On 12/03/2012 08:42 AM, Roy wrote: >> MSYS libc does not support %j[dXx] format, only %ll[dXx] is supported. >> >> diff --git a/src/bltin/printf.c b/src/bltin/printf.c >> index 893295c..12ce660 100644 >> --- 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 = c...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Use PRIdMAX instead of %j in printf
...N] Use PRIdMAX instead of %j in printf [ dash commit 5464ae7d9e226586b79527cb445d892177b70271 ] On 12/03/2012 05:59 PM, Harald van Dijk wrote: > On 12/03/2012 08:42 AM, Roy wrote: >> MSYS libc does not support %j[dXx] format, only %ll[dXx] is supported. >> >> diff --git a/src/bltin/printf.c b/src/bltin/printf.c >> index 893295c..12ce660 100644 >> --- 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 = c...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Fixed argument parsing crash in test
...rther up the call chain because we've advanced t_wp too far. Fix it by checking for EOI in nexpr and only advancing t_wp if we've got more arguments. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/test.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/dash/bltin/test.c b/usr/dash/bltin/test.c index 90135e14..baa91a57 100644 --- a/usr/dash/bltin/test.c +++ b/usr/dash/bltin/test.c @@ -268,9 +268,13 @@ aexpr(enum token n) static int nexpr(enum token n) { -...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Correctly handle test ! ! = !
...Note that this special case does not extend down into subexpressions so if ! ! = ! is used inside parentheses then a syntax error will still occur as before. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/test.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/dash/bltin/test.c b/usr/dash/bltin/test.c index baa91a57..458e9f55 100644 --- a/usr/dash/bltin/test.c +++ b/usr/dash/bltin/test.c @@ -177,7 +177,7 @@ testcmd(int argc, char **argv) { const struct t_op *op;...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Add printf support for format string a, A, and F
...the format string characters a, A and F to the supported set of the built-in printf command. They're already supported by the underlying printf function. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index add89095..a1c1e918 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -194,9 +194,12 @@ pc: break; } #ifdef HAVE_STRTOD + case 'a': + case...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Remove unnecessary restoration of format string in printf
...ve the format string which is stored in argv after temporarily modifying it. This is unnecessary as it's only ever used once. This patch gets rid of it. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index d49d4454..5cd34a19 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -209,7 +209,6 @@ pc: if (print_escape_str(start, param, array, getstr()))...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Use error instead of warnx for fatal errors in printf
...warnx where we abort with error since the effect is the same. The exit status however changes from 1 to 2. Non-fatal errors where we continue are unchanged. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index b439a3bb..72f89883 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -134,10 +134,8 @@ int printfcmd(int argc, char *argv[])...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Optimise handling of backslash octals in printf
...[BUILTIN] Optimise handling of backslash octals in printf This patch removes the duplicate octal handling for %b by reusing the existing code in conv_escape. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index 72f89883..0e150d36 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -276,8 +276,8 @@ conv_escape_str(char *str, c...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Simplify echo command
...4 16:23:33 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] [BUILTIN] Simplify echo command Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index 0e150d36..d4ae794d 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -448,33 +448,21 @@ check_conversion(const char...
2019 Jan 25
0
[klibc:update-dash] builtin: Reset t_wp_op in testcmd
..._op needs to be reset every time testcmd is called or it may cause incorrect parsing of the arguments. Reported-by: Martijn Dekker <martijn at inlv.org> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr/dash/bltin/test.c b/usr/dash/bltin/test.c index bab9a1f9..58c05fec 100644 --- a/usr/dash/bltin/test.c +++ b/usr/dash/bltin/test.c @@ -193,6 +193,8 @@ testcmd(int argc, char **argv) argv[argc] = NULL; } + t_wp_op = NULL; + rech...
2019 Jan 25
0
[klibc:update-dash] builtin: Reject malformed printf specifications with digits after '*'
.../cgi-bin/bugreport.cgi?bug=779618 Originally-by: Patrick Brown <opensource at whoopdedo.org> Forwarded-by: Gioele Barabucci <gioele at svario.it> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index d4ae794d..78bf388a 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -177,17 +177,24 @@ pc: /* skip to field width...
2019 Jan 25
0
[klibc:update-dash] builtin: Fix echo -n early termination
...ched the end of the arguments. Fixes: 7a784244625d ("[BUILTIN] Simplify echo command") Reported-by: Luigi Tarenga <luigi.tarenga at gmail.com> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index 78bf388a..9da4ffef 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -465,7 +465,7 @@ echocmd(int argc, char **argv) if (likely(*argv)) n...
2019 Jan 25
0
[klibc:update-dash] builtin: Greater resolution in test -nt / test -ot
...not have st_mtim. So I > think it needs a configure test and a fallback to the old method. Here's an attempt to make that happen. See attached. - M. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/test.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/usr/dash/bltin/test.c b/usr/dash/bltin/test.c index 58c05fec..d1458df3 100644 --- a/usr/dash/bltin/test.c +++ b/usr/dash/bltin/test.c @@ -476,9 +476,17 @@ newerf (const char *f1, const char *f2) { struct stat b1, b2;...
2019 Jan 25
0
[klibc:update-dash] Revert "[BUILTIN] Remove unnecessary restoration of format string in printf"
...restoration of format string in printf" This reverts commit 7bb413255368e94395237d789f522891093c5774. The commit breaks printf with more than argument. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index 9da4ffef..1f1fbde7 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -211,6 +211,7 @@ pc: if (print_escape_str(start, param, array, getstr()))...
2019 Jan 25
0
[klibc:update-dash] builtin: Fix echo performance regression
...path when no precision/field width modifiers are present. This patch also changes the second strchurnul call to strspn which generates slightly better code. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index 1f1fbde7..fe055fd2 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -100,20 +100,25 @@ static int print_escape_str(const cha...
2019 Jan 25
0
[klibc:update-dash] builtin: Move echo space/nl handling into print_escape_str
...rt from printing the spaces/newlines separating its arguments. This patch moves the actual printing into print_escape_str as well using the format parameter. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index fe055fd2..5fa0f5db 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -105,6 +105,8 @@ static int print_escape_str(const...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Fixed argument parsing crash in test
...rther up the call chain because we've advanced t_wp too far. Fix it by checking for EOI in nexpr and only advancing t_wp if we've got more arguments. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/test.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/dash/bltin/test.c b/usr/dash/bltin/test.c index 90135e14..baa91a57 100644 --- a/usr/dash/bltin/test.c +++ b/usr/dash/bltin/test.c @@ -268,9 +268,13 @@ aexpr(enum token n) static int nexpr(enum token n) { -...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Correctly handle test ! ! = !
...Note that this special case does not extend down into subexpressions so if ! ! = ! is used inside parentheses then a syntax error will still occur as before. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/test.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/dash/bltin/test.c b/usr/dash/bltin/test.c index baa91a57..458e9f55 100644 --- a/usr/dash/bltin/test.c +++ b/usr/dash/bltin/test.c @@ -177,7 +177,7 @@ testcmd(int argc, char **argv) { const struct t_op *op;...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Add printf support for format string a, A, and F
...A and F to the supported set of the built-in printf command. They're already supported by the underlying printf function. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> [bwh: Adjust context for klibc] Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index add89095..a1c1e918 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -194,9 +194,12 @@ pc: break; } #ifdef HAVE_STRTOD + case 'a': + case...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Remove unnecessary restoration of format string in printf
...ve the format string which is stored in argv after temporarily modifying it. This is unnecessary as it's only ever used once. This patch gets rid of it. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/bltin/printf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c index d49d4454..5cd34a19 100644 --- a/usr/dash/bltin/printf.c +++ b/usr/dash/bltin/printf.c @@ -209,7 +209,6 @@ pc: if (print_escape_str(start, param, array, getstr()))...