From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Output strings from echo with puts where easy
Date: Fri, 17 Aug 2012 19:40:39 -0400 [thread overview]
Message-ID: <201208171940.40143.vapier@gentoo.org> (raw)
In-Reply-To: <1345236918-19775-1-git-send-email-joe.hershberger@ni.com>
On Friday 17 August 2012 16:55:18 Joe Hershberger wrote:
> --- a/common/cmd_echo.c
> +++ b/common/cmd_echo.c
>
> - while ((c = *p++) != '\0') {
> - if (c == '\\' && *p == 'c') {
> - putnl = 0;
> - p++;
> - } else {
> - putc(c);
> - }
> +
> + nls = strstr(p, "\\c");
> + if (nls) {
> + putnl = 0;
> + *nls = '\0';
> + puts(p);
> + puts(nls + 2);
> + *nls = '\\';
> + } else {
> + puts(p);
> }
> }
what if someone uses \c multiple times ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120817/a9ea0305/attachment.pgp>
next prev parent reply other threads:[~2012-08-17 23:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-17 20:55 [U-Boot] [PATCH] Output strings from echo with puts where easy Joe Hershberger
2012-08-17 23:40 ` Mike Frysinger [this message]
2012-10-03 23:09 ` [U-Boot] [PATCH v2] " Joe Hershberger
2012-10-04 1:20 ` [U-Boot] [U-Boot, " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201208171940.40143.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox