[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] Possible tar bug with -C, --from-files stdin and --null
From: |
John Hein |
Subject: |
Re: [Bug-tar] Possible tar bug with -C, --from-files stdin and --null |
Date: |
Tue, 23 Sep 2008 11:13:00 -0600 |
Sergey Poznyakoff wrote at 19:59 +0300 on Sep 23, 2008:
> Daryl Tester <address@hidden> ha escrit:
>
> > I seem to have hit a possible bug with gnu-tar (versions 1.19 and 1.16)
> > trying to use the --null form of --from-files (-T) in conjunction with
> > -C (change directory).
>
> Thanks for reporting, it is a bug, indeed. To fix, apply the attached
> patch.
You may want to update the info page...
==============
The `--null' option is just like the one in GNU `xargs' and `cpio',
and is useful with the `-print0' predicate of GNU `find'. In `tar',
`--null' also causes `--directory=DIRECTORY' (`-C DIRECTORY') options
to be treated as file names to archive, in case there are any files out
there called `-C'.
==============
This is at least somewhat unclear.
> Regards,
> Sergey
>
> Index: src/names.c
> ===================================================================
> RCS file: /cvsroot/tar/tar/src/names.c,v
> retrieving revision 1.65
> diff -p -u -r1.65 names.c
> --- src/names.c 5 May 2008 21:30:58 -0000 1.65
> +++ src/names.c 23 Sep 2008 16:56:08 -0000
> @@ -289,9 +289,8 @@ static int matching_flags; /* exclude_fn
> static storage and can't be relied upon across two calls.
>
> If CHANGE_DIRS is true, treat any entries of type NELT_CHDIR as
> - the request to change to the given directory. If filename_terminator
> - is NUL, CHANGE_DIRS is effectively always false.
> -
> + the request to change to the given directory.
> +
> Entries of type NELT_FMASK cause updates of the matching_flags
> value. */
> struct name_elt *
> @@ -301,9 +300,6 @@ name_next_elt (int change_dirs)
> const char *source;
> char *cursor;
>
> - if (filename_terminator == '\0')
> - change_dirs = 0;
> -
> while (name_index != names)
> {
> struct name_elt *ep;