Subject: pax-tar -C enhancement proposal
To: None <>
From: Ignatios Souvatzis <>
List: tech-userlevel
Date: 07/23/1999 16:51:40

it has come to my attention that:

<hubertf> phone: "you" would have to fix things that use multiple -Cs first
	  (-> pkg_*)

is the main reason we still need to ship with gnu tar in the base distribution.

I looked at the code, and propose this plan to add positional -C arguments:

a) in pax.c: move the tail of main() to a new function, starting
right after the options() call. 

Actually, we need 2 of them:
- one which calls gen_init(), tty_init(), time(&starttime) and sets up
  the signal handler, main_inits(). Make it use exit() instead of return()
  for errors.

- one which contains the switch: main_switch().

b1) in pat_rep.c, add a function pat_clear() that clears the linked list of
patterns (after freeing the members).

b2) in ftree.c, add a function ftree_clear() that clears the linked file list
(after freeing the members).

c) in options.c:tar_options(), compare each argv[N] to "-C" before processing
it as a file/pattern.

If yes {
	if (!inited)
	chdir_name = *++argv;
	pat_clear(); ftree_clear();
	if (no more argv) {usage() and exit()}
	goto start of loop.

d) in options.c:allother_options, add a call of main_inits() and main_switch()
at the end.


 * Progress (n.): The process through which Usenet has evolved from
   smart people in front of dumb terminals to dumb people in front of
   smart terminals.  -- (obscurity)