Skip file or archive member if its transformed name is empty.
* NEWS: Document changes. * doc/tar.texi: Document changes. * src/common.h (transform_stat_info): Change return value. (transform_name_fp): Change signature. (WARN_EMPTY_TRANSFORM): New constant. * src/create.c: Check return from transform_name. Skip file, if it is false. * src/list.c (transform_stat_info): Return bool. (read_and): Skip member if transform_stat_info returns false. * src/transform.c (_transform_name_to_obstack): Change return type. Always allocate result in obstack. (transform_name_fp): Change arguments. Return true on success (transformed string not empty). Otherwise return false and don't change the source string. * src/warning.c: New warning class: empty-transform. * tests/extrac17.at: Use --warning=empty-transform.
This commit is contained in:
@@ -38,7 +38,9 @@ genfile --file dir/subdir2/file2
|
||||
|
||||
tar cf dir.tar dir
|
||||
|
||||
tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \
|
||||
tar -x -v -f dir.tar -C out --strip-components=2 \
|
||||
--warning=no-empty-transform \
|
||||
--warning=no-timestamp \
|
||||
dir/subdir1/
|
||||
],
|
||||
[0],
|
||||
|
||||
Reference in New Issue
Block a user