FreeBSD Bugzilla – Attachment 235435 Details for
Bug 265399
/bin/sh: improve echo -e builtin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
235434: naive fix to echo -n -e
echo.diff (text/plain), 797 bytes, created by
Helge Oldach
on 2022-07-23 06:42:11 UTC
(
hide
)
Description:
235434: naive fix to echo -n -e
Filename:
MIME Type:
Creator:
Helge Oldach
Created:
2022-07-23 06:42:11 UTC
Size:
797 bytes
patch
obsolete
>diff --git a/bin/sh/bltin/echo.c b/bin/sh/bltin/echo.c >index e8046c7615e..0e8cfc9e902 100644 >--- a/bin/sh/bltin/echo.c >+++ b/bin/sh/bltin/echo.c >@@ -62,15 +62,29 @@ main(int argc, char *argv[]) > ap = argv; > if (argc) > ap++; >- if ((p = *ap) != NULL) { >- if (equal(p, "-n")) { >- nflag++; >- ap++; >- } else if (equal(p, "-e")) { >+ for (count = 0; count < 2; count++) { >+ if ((p = *ap) != NULL) { >+ if (equal(p, "-n")) { >+ nflag++; >+ ap++; >+ } else if (equal(p, "-e")) { > #ifndef eflag >- eflag++; >+ eflag++; > #endif >- ap++; >+ ap++; >+ } else if (equal(p, "-ne")) { >+ nflag++; >+#ifndef eflag >+ eflag++; >+#endif >+ ap++; >+ } else if (equal(p, "-en")) { >+ nflag++; >+#ifndef eflag >+ eflag++; >+#endif >+ ap++; >+ } > } > } > while ((p = *ap++) != NULL) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 265399
:
235434
|
235435
|
235436