From b7606824fda48ee8528dcd84dc514632b88aae33 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 25 Jul 2023 07:35:54 -0500 Subject: [PATCH] Ignore blank lines in name list. --- toys/posix/cpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/toys/posix/cpio.c b/toys/posix/cpio.c index 48b9b889..13fb8c58 100644 --- a/toys/posix/cpio.c +++ b/toys/posix/cpio.c @@ -265,6 +265,7 @@ void cpio_main(void) len = getline(&name, &size, stdin); if (len<1) break; if (name[len-1] == '\n') name[--len] = 0; + if (!len) continue; nlen = len+1; if ((FLAG(L)?stat:lstat)(name, &st) || (S_ISREG(st.st_mode) && st.st_size && (fd = open(name, O_RDONLY))<0) -- 2.39.2