Skip to content

Commit

Permalink
Ignore blank lines in name list.
Browse files Browse the repository at this point in the history
  • Loading branch information
landley committed Jul 25, 2023
1 parent f782f53 commit b760682
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions toys/posix/cpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b760682

Please sign in to comment.