From: Patrick Gefre <pfg@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] Altix console mod
Date: Tue, 27 Jul 2004 20:29:35 +0000 [thread overview]
Message-ID: <4106BB2F.3080105@sgi.com> (raw)
In-Reply-To: <200407271953.i6RJrAma119179@fsgi900.americas.sgi.com>
Andreas Schwab wrote:
> Pat Gefre <pfg@sgi.com> writes:
>
>
>>@@ -978,19 +981,21 @@
>> * ia64_sn_console_putb (what sal_puts_raw below actually does).
>> *
>> */
>>-static void puts_raw_fixed(const char *s, int count)
>>+
>>+static void puts_raw_fixed(int (*puts_raw) (const char *s, int len), const char *s, int count)
>> {
>> const char *s1;
>>- struct sn_cons_port *port = &sal_console_port;
>>
>> /* Output '\r' before each '\n' */
>> while ((s1 = memchr(s, '\n', count)) != NULL) {
>>- port->sc_ops->sal_puts_raw(s, s1 - s);
>>- port->sc_ops->sal_puts_raw("\r\n", 2);
>>+ if ( (*(s1 - 1) != '\r') && (*(s1 + 1) != '\r') ) {
>>+ puts_raw(s, s1 - s);
>>+ puts_raw("\r\n", 2);
>>+ }
>
>
> You have now broken output when a CR actually appears in the string.
> What's wrong with unconditionally writing a CR before each LF? That's
> what every other console print function is doing.
>
> Andreas.
>
You're right, I forgot the else on the if (to write out the lf) ....
So send the cr even if one is already there - guess it doesn't hurt ?
-- Pat
next prev parent reply other threads:[~2004-07-27 20:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-27 19:53 [PATCH] Altix console mod Pat Gefre
2004-07-27 20:10 ` Andreas Schwab
2004-07-27 20:29 ` Patrick Gefre [this message]
2004-07-27 20:42 ` Andreas Schwab
2004-07-28 18:10 ` Pat Gefre
2004-07-28 18:18 ` Jesse Barnes
2004-07-29 15:15 ` Pat Gefre
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=4106BB2F.3080105@sgi.com \
--to=pfg@sgi.com \
--cc=linux-ia64@vger.kernel.org \
/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