cvs commit: ALFS/nALFS/src/handlers copy.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Sat Feb 28 19:16:55 PST 2004


kpfleming    04/02/28 20:16:55

  Modified:    nALFS/src/handlers copy.c
  Log:
  change option handling to better conform to DTD 2.0 and 3.0+
  
  Revision  Changes    Path
  1.21      +25 -2     ALFS/nALFS/src/handlers/copy.c
  
  Index: copy.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/copy.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- copy.c	29 Feb 2004 03:13:47 -0000	1.20
  +++ copy.c	29 Feb 2004 03:16:55 -0000	1.21
  @@ -145,11 +145,34 @@
   			option_found++;
   		}
   		if (!option_found) {
  -			Nprint_err("<copy>: invalid option (%s) ignored", value);
  +			Nprint_err("<copy>: invalid options in (%s) ignored", value);
   			return 1;
   		} else {
   			return 0;
   		}
  +	case COPY_OPTION:
  +		if (!strcmp("force", value)) {
  +			data->force = 1;
  +			return 0;
  +		}
  +		if (!strcmp("archive", value)) {
  +			data->archive = 1;
  +			return 0;
  +		}
  +		if (!strcmp("preserve", value)) {
  +			data->preserve = 1;
  +			return 0;
  +		}
  +		if (!strcmp("recursive", value)) {
  +			data->recursive = 1;
  +			return 0;
  +		}
  +		if (!strcmp("no-dereference", value)) {
  +			data->no_dereference = 1;
  +			return 0;
  +		}
  +		Nprint_err("<copy>: invalid option (%s) ignored", value);
  +		return 1;
   	case COPY_SOURCE:
   		data->source_count++;
   		if ((data->sources = xrealloc(data->sources,
  @@ -256,7 +279,7 @@
   #if HANDLER_SYNTAX_3_0 || HANDLER_SYNTAX_3_1 || HANDLER_SYNTAX_3_2
   
   static const struct handler_parameter copy_parameters_v3[] = {
  -	{ .name = "option", .private = COPY_OPTIONS },
  +	{ .name = "option", .private = COPY_OPTION },
   	{ .name = "source", .private = COPY_SOURCE },
   	{ .name = "destination", .private = COPY_DESTINATION },
   	{ .name = NULL }
  
  
  



More information about the alfs-log mailing list