2.1.3[12] - stupid bug in printk - patch

root (root@Elf.mj.gts.cz)
Sun, 6 Apr 1997 23:29:39 +0200


Hi!

There's a stupid bug which causes printk to incorrectly print one more
space after each call to print on console, so output looks something
like:

hda: hda1 hda2 hda3 hda4
instead of
hda: hda1 hda2 hda3 hda4

and I call this ugly. Here's patch, bug appeared in 2.1.31.

Pavel

--- ../linux/kernel/printk.c.ofic Sun Apr 6 21:36:48 1997
+++ ../linux/kernel/printk.c Sun Apr 6 22:45:00 1997
@@ -218,7 +218,7 @@
struct console *c = console_drivers;
while(c) {
if (c->write)
- c->write(msg, p - msg + 1);
+ c->write(msg, p - msg + (*p == '\n'));
c = c->next;
}
}