Bug 15985 - tar with multiple -C incorrectly processes them
Summary: tar with multiple -C incorrectly processes them
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-11 22:08 UTC by Yuri Astrakhan
Modified: 2024-03-11 22:08 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.