Bug 15985

Summary: tar with multiple -C incorrectly processes them
Product: Busybox Reporter: Yuri Astrakhan <yuriastrakhan>
Component: Standard ComplianceAssignee: unassigned
Status: NEW ---    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Yuri Astrakhan 2024-03-11 22:08:23 UTC
The standard tar can take multiple `-C` params (change dir before compressing), so if I have multiple files in multiple dirs, I can tar them all by prepending each subset of files with their directory:

```
tar -czf newfile.tar.gz \
         -C $PWD/dir1 file1 file2 \
         -C $PWD/dir2 file3 file4
```

Busybox tar ignores all but the last `-C`, which results in `file1` and `file2` not found.