diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-05-08 14:01:34 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-05-08 14:01:34 +0100 |
commit | 4645b6f17f0da81e9fe84081fb126a37102ba153 (patch) | |
tree | e6c48cf3db2213af38cf528a5364fffd5c74c6d6 /app-shells/dash/files | |
parent | ebce8994fe3cc4ca9fbc96ca837cb4c4e98adcbd (diff) |
gentoo resync : 08.05.2018
Diffstat (limited to 'app-shells/dash/files')
-rw-r--r-- | app-shells/dash/files/dash-0.5.10-dumb-echo.patch (renamed from app-shells/dash/files/dash-0.5.8.1-dumb-echo.patch) | 57 | ||||
-rw-r--r-- | app-shells/dash/files/dash-0.5.8.1-eval-warnx.patch | 12 |
2 files changed, 22 insertions, 47 deletions
diff --git a/app-shells/dash/files/dash-0.5.8.1-dumb-echo.patch b/app-shells/dash/files/dash-0.5.10-dumb-echo.patch index 4059a80e3301..6b19b5b59f70 100644 --- a/app-shells/dash/files/dash-0.5.8.1-dumb-echo.patch +++ b/app-shells/dash/files/dash-0.5.10-dumb-echo.patch @@ -9,52 +9,40 @@ however, since the behavior is not portable, no one should be relying on echo having any specific behavior. they should use `printf` when they want an escape sequence. it also makes dash smaller & faster to disable this logic entirely. ---- a/src/bltin/printf.c -+++ b/src/bltin/printf.c -@@ -439,34 +444,12 @@ +--- dash-0.5.10/src/bltin/printf.c ++++ dash-0.5.10/src/bltin/printf.c +@@ -457,22 +457,13 @@ int echocmd(int argc, char **argv) { -- int nonl = 0; -- struct output *outs = out1; -- -- if (!*++argv) -- goto end; -- if (equal(*argv, "-n")) { -- nonl = ~nonl; -- if (!*++argv) -- goto end; +- const char *lastfmt = snlfmt; +- int nonl; + int i; + +- if (*++argv && equal(*argv, "-n")) { +- argv++; +- lastfmt = "%s"; + for (i = 1; i < argc; ++i) { + outstr(argv[i], out1); -+ if (i < argc - 1) ++ if (1 < argc - 1) + outc(' ', out1); } - - do { -- int c; +- const char *fmt = "%s "; +- char *s = *argv; - -- nonl += conv_escape_str(*argv); -- outstr(stackblock(), outs); -- if (nonl > 0) -- break; +- if (!s || !*++argv) +- fmt = lastfmt; - -- c = ' '; -- if (!*++argv) { --end: -- if (nonl) { -- break; -- } -- c = '\n'; -- } -- outc(c, outs); -- } while (*argv); +- nonl = print_escape_str(fmt, NULL, NULL, s ?: nullstr); +- } while (!nonl && *argv); + outc('\n', out1); return 0; } ---- a/src/dash.1 -+++ b/src/dash.1 -@@ -1180,43 +1180,15 @@ +--- dash-0.5.10/src/dash.1 ++++ dash-0.5.10/src/dash.1 +@@ -1182,43 +1182,15 @@ option turns off the effect of any preceding .Fl P options. @@ -66,7 +54,7 @@ sequence. it also makes dash smaller & faster to disable this logic entirely. -Unless the -.Fl n -option is present, a newline is output following the arguments. --.Pp + .Pp -If any of the following sequences of characters is encountered during -output, the sequence is not output. Instead, the specified action is -performed: @@ -94,11 +82,10 @@ sequence. it also makes dash smaller & faster to disable this logic entirely. -.It Li \e\e -Output a backslash. -.El - .Pp --All other backslash sequences elicit undefined behaviour. +No arguments or backslash sequences are supported as they are not portable. +They will be printed out exactly as passed in. -+.Pp + .Pp +-All other backslash sequences elicit undefined behaviour. +You can replace `echo -n ...` with the portable `printf %s ...` construct. .It eval Ar string ... Concatenate all the arguments with spaces. diff --git a/app-shells/dash/files/dash-0.5.8.1-eval-warnx.patch b/app-shells/dash/files/dash-0.5.8.1-eval-warnx.patch deleted file mode 100644 index 51530bfdaf53..000000000000 --- a/app-shells/dash/files/dash-0.5.8.1-eval-warnx.patch +++ /dev/null @@ -1,12 +0,0 @@ -fix one of the Debian patches -- it uses warnx but doesn't include err.h. - ---- a/src/eval.c -+++ b/src/eval.c -@@ -36,6 +36,7 @@ - #include <signal.h> - #include <unistd.h> - #include <sys/types.h> -+#include <err.h> - - /* - * Evaluate a command. |