mirror of
https://github.com/troglobit/finit.git
synced 2026-11-19 19:40:50 +00:00
getty: fix regression introduced in 5342881
Replacing write() with dprint() without thinking leads to duplicate output in getty. In particular '\n login: foo login: ". Must check if length is > 0, or dprint() will calculate it on its own. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
90f7ff1c23
commit
8ed223343d
1 file changed
+4
-2
+4
-2
@@ -71,7 +71,8 @@ static void do_parse(char *line, struct utsname *uts, char *tty)
|
|||||||
s0 = line;
|
s0 = line;
|
||||||
for (s = line; *s != 0; s++) {
|
for (s = line; *s != 0; s++) {
|
||||||
if (*s == '\\') {
|
if (*s == '\\') {
|
||||||
dprint(STDOUT_FILENO, s0, s - s0);
|
if ((s - s0) > 0)
|
||||||
|
dprint(STDOUT_FILENO, s0, s - s0);
|
||||||
s0 = s + 2;
|
s0 = s + 2;
|
||||||
switch (*++s) {
|
switch (*++s) {
|
||||||
case 'l':
|
case 'l':
|
||||||
@@ -106,7 +107,8 @@ static void do_parse(char *line, struct utsname *uts, char *tty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
dprint(STDOUT_FILENO, s0, s - s0);
|
if ((s - s0) > 0)
|
||||||
|
dprint(STDOUT_FILENO, s0, s - s0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in new issue
Block a user