journalctl: honour -n if -F is used

This commit is contained in:
Lennart Poettering 2012-10-18 22:55:12 +02:00
parent 0902aa1838
commit fd6e887537
1 changed files with 5 additions and 0 deletions

View File

@ -926,11 +926,16 @@ int main(int argc, char *argv[]) {
SD_JOURNAL_FOREACH_UNIQUE(j, data, size) {
const void *eq;
if (arg_lines > 0 && n_shown >= arg_lines)
break;
eq = memchr(data, '=', size);
if (eq)
printf("%.*s\n", (int) (size - ((const uint8_t*) eq - (const uint8_t*) data + 1)), (const char*) eq + 1);
else
printf("%.*s\n", (int) size, (const char*) data);
n_shown ++;
}
r = 0;