aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2025-10-23 11:22:28 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2025-11-08 07:42:34 +0100
commit782e3fc2b4012958d43e964064fd2f2806d46106 (patch)
treeb0dbb0b11d5d476f46ab8392f1e271f41feb55c4 /util-linux
parentb99a529177b4adbe3b3f5a86f46b9cf386d4cbe4 (diff)
downloadbusybox-w32-782e3fc2b4012958d43e964064fd2f2806d46106.tar.gz
busybox-w32-782e3fc2b4012958d43e964064fd2f2806d46106.tar.bz2
busybox-w32-782e3fc2b4012958d43e964064fd2f2806d46106.zip
last: fix ignoring the first login entry
The first login entry is ignored if a log file contains more than one entry. To fix it, do not break the while loop if the offset is zero. Signed-off-by: Dmitry Klochkov <dmitry.klochkov@bell-sw.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/last.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util-linux/last.c b/util-linux/last.c
index 7530d013d..aafd01bb9 100644
--- a/util-linux/last.c
+++ b/util-linux/last.c
@@ -157,7 +157,7 @@ int last_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
157 ut.ut_user, ut.ut_line, ut.ut_host, ctime(&t_tmp) + 4); 157 ut.ut_user, ut.ut_line, ut.ut_host, ctime(&t_tmp) + 4);
158 next: 158 next:
159 pos -= sizeof(ut); 159 pos -= sizeof(ut);
160 if (pos <= 0) 160 if (pos < 0)
161 break; /* done. */ 161 break; /* done. */
162 xlseek(file, pos, SEEK_SET); 162 xlseek(file, pos, SEEK_SET);
163 } 163 }