← Commit list

3d40dfabe

Denys Vlasenko
Denys Vlasenko
2021-08-02
SUCCESS Duration: 151s

Subject

tar: simplify addition of --exclude=GLOB to the expansion of -X EXCLFILE

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/tar.c+7 -6
@@ -1132,14 +1132,15 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
tar_handle->ah_flags &= ~ARCHIVE_RESTORE_DATE;
#if ENABLE_FEATURE_TAR_FROM
+ /* Convert each -X EXCLFILE to list of to-be-rejected glob patterns */
tar_handle->reject = append_file_list_to_list(tar_handle->reject);
# if ENABLE_FEATURE_TAR_LONG_OPTIONS
- /* Append excludes to reject */
- while (excludes) {
- llist_t *next = excludes->link;
- excludes->link = tar_handle->reject;
- tar_handle->reject = excludes;
- excludes = next;
+ /* Append --exclude=GLOBPATTERNs to reject */
+ if (excludes) {
+ llist_t **p2next = &tar_handle->reject;
+ while (*p2next)
+ p2next = &((*p2next)->link);
+ *p2next = excludes;
}
# endif
tar_handle->accept = append_file_list_to_list(tar_handle->accept);