pat_rep.c (102230) | pat_rep.c (108533) |
---|---|
1/*- 2 * Copyright (c) 1992 Keith Muller. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Keith Muller of the University of California, San Diego. 8 * --- 27 unchanged lines hidden (view full) --- 36 */ 37 38#ifndef lint 39#if 0 40static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94"; 41#endif 42#endif /* not lint */ 43#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1992 Keith Muller. 3 * Copyright (c) 1992, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Keith Muller of the University of California, San Diego. 8 * --- 27 unchanged lines hidden (view full) --- 36 */ 37 38#ifndef lint 39#if 0 40static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94"; 41#endif 42#endif /* not lint */ 43#include <sys/cdefs.h> |
44__FBSDID("$FreeBSD: head/bin/pax/pat_rep.c 102230 2002-08-21 17:32:44Z trhodes $"); | 44__FBSDID("$FreeBSD: head/bin/pax/pat_rep.c 108533 2003-01-01 18:49:04Z schweikh $"); |
45 46#include <sys/types.h> 47#include <sys/stat.h> 48#include <stdio.h> 49#include <string.h> 50#include <unistd.h> 51#include <stdlib.h> 52#include <errno.h> --- 238 unchanged lines hidden (view full) --- 291 * pat_sel() 292 * the archive member which matches a pattern was selected. Mark the 293 * pattern as having selected an archive member. arcn->pat points at the 294 * pattern that was matched. arcn->pat is set in pat_match() 295 * 296 * NOTE: When the -c option is used, we are called when there was no match 297 * by pat_match() (that means we did match before the inverted sense of 298 * the logic). Now this seems really strange at first, but with -c we | 45 46#include <sys/types.h> 47#include <sys/stat.h> 48#include <stdio.h> 49#include <string.h> 50#include <unistd.h> 51#include <stdlib.h> 52#include <errno.h> --- 238 unchanged lines hidden (view full) --- 291 * pat_sel() 292 * the archive member which matches a pattern was selected. Mark the 293 * pattern as having selected an archive member. arcn->pat points at the 294 * pattern that was matched. arcn->pat is set in pat_match() 295 * 296 * NOTE: When the -c option is used, we are called when there was no match 297 * by pat_match() (that means we did match before the inverted sense of 298 * the logic). Now this seems really strange at first, but with -c we |
299 * need to keep track of those patterns that cause a archive member to NOT | 299 * need to keep track of those patterns that cause an archive member to NOT |
300 * be selected (it found an archive member with a specified pattern) 301 * Return: 302 * 0 if the pattern pointed at by arcn->pat was tagged as creating a 303 * match, -1 otherwise. 304 */ 305 306int 307pat_sel(ARCHD *arcn) --- 158 unchanged lines hidden (view full) --- 466 /* 467 * return the result, remember that cflag (-c) inverts the sense of a 468 * match 469 */ 470 if (pt == NULL) 471 return(cflag ? 0 : 1); 472 473 /* | 300 * be selected (it found an archive member with a specified pattern) 301 * Return: 302 * 0 if the pattern pointed at by arcn->pat was tagged as creating a 303 * match, -1 otherwise. 304 */ 305 306int 307pat_sel(ARCHD *arcn) --- 158 unchanged lines hidden (view full) --- 466 /* 467 * return the result, remember that cflag (-c) inverts the sense of a 468 * match 469 */ 470 if (pt == NULL) 471 return(cflag ? 0 : 1); 472 473 /* |
474 * we had a match, now when we invert the sense (-c) we reject this | 474 * We had a match, now when we invert the sense (-c) we reject this |
475 * member. However we have to tag the pattern a being successful, (in a | 475 * member. However we have to tag the pattern a being successful, (in a |
476 * match, not in selecting a archive member) so we call pat_sel() here. | 476 * match, not in selecting an archive member) so we call pat_sel() here. |
477 */ 478 arcn->pat = pt; 479 if (!cflag) 480 return(0); 481 482 if (pat_sel(arcn) < 0) 483 return(-1); 484 arcn->pat = NULL; --- 650 unchanged lines hidden --- | 477 */ 478 arcn->pat = pt; 479 if (!cflag) 480 return(0); 481 482 if (pat_sel(arcn) < 0) 483 return(-1); 484 arcn->pat = NULL; --- 650 unchanged lines hidden --- |