From: Andreas Schwab <schwab@suse.de>
To: linux-ia64@vger.kernel.org
Subject: Re: [PATCH] Altix console mod
Date: Tue, 27 Jul 2004 20:10:55 +0000 [thread overview]
Message-ID: <jesmbd8b3k.fsf@sykes.suse.de> (raw)
In-Reply-To: <200407271953.i6RJrAma119179@fsgi900.americas.sgi.com>
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.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2004-07-27 20:10 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 [this message]
2004-07-27 20:29 ` Patrick Gefre
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=jesmbd8b3k.fsf@sykes.suse.de \
--to=schwab@suse.de \
--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