diff options
| -rw-r--r-- | util-linux/dmesg.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c index 6505da54b..81ba1c9d1 100644 --- a/util-linux/dmesg.c +++ b/util-linux/dmesg.c | |||
| @@ -59,16 +59,15 @@ int dmesg_main(int argc UNUSED_PARAM, char **argv) | |||
| 59 | int last = '\n'; | 59 | int last = '\n'; |
| 60 | int in = 0; | 60 | int in = 0; |
| 61 | 61 | ||
| 62 | /* Skip <#> at the start of lines */ | 62 | /* Skip <[0-9]+> at the start of lines */ |
| 63 | while (1) { | 63 | while (1) { |
| 64 | if (last == '\n' && buf[in] == '<') { | 64 | if (last == '\n' && buf[in] == '<') { |
| 65 | in += 3; | 65 | while (buf[in++] != '>' && in < len) |
| 66 | if (in >= len) | 66 | ; |
| 67 | break; | 67 | } else { |
| 68 | last = buf[in++]; | ||
| 69 | putchar(last); | ||
| 68 | } | 70 | } |
| 69 | last = buf[in]; | ||
| 70 | putchar(last); | ||
| 71 | in++; | ||
| 72 | if (in >= len) | 71 | if (in >= len) |
| 73 | break; | 72 | break; |
| 74 | } | 73 | } |
