apply.c (54113) | apply.c (54157) |
---|---|
1/*- 2 * Copyright (c) 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Jan-Simon Pendry. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 25 unchanged lines hidden (view full) --- 34 * SUCH DAMAGE. 35 */ 36 37#ifndef lint 38#if 0 39static const char sccsid[] = "@(#)apply.c 8.4 (Berkeley) 4/4/94"; 40#endif 41static const char rcsid[] = | 1/*- 2 * Copyright (c) 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Jan-Simon Pendry. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 25 unchanged lines hidden (view full) --- 34 * SUCH DAMAGE. 35 */ 36 37#ifndef lint 38#if 0 39static const char sccsid[] = "@(#)apply.c 8.4 (Berkeley) 4/4/94"; 40#endif 41static const char rcsid[] = |
42 "$FreeBSD: head/usr.bin/apply/apply.c 54113 1999-12-04 02:19:33Z kris $"; | 42 "$FreeBSD: head/usr.bin/apply/apply.c 54157 1999-12-05 19:53:37Z charnier $"; |
43#endif /* not lint */ 44 45#include <sys/wait.h> 46 47#include <ctype.h> 48#include <err.h> 49#include <paths.h> 50#include <signal.h> --- 16 unchanged lines hidden (view full) --- 67 debug = 0; 68 magic = '%'; /* Default magic char is `%'. */ 69 nargs = -1; 70 while ((ch = getopt(argc, argv, "a:d0123456789")) != -1) 71 switch (ch) { 72 case 'a': 73 if (optarg[1] != '\0') 74 errx(1, | 43#endif /* not lint */ 44 45#include <sys/wait.h> 46 47#include <ctype.h> 48#include <err.h> 49#include <paths.h> 50#include <signal.h> --- 16 unchanged lines hidden (view full) --- 67 debug = 0; 68 magic = '%'; /* Default magic char is `%'. */ 69 nargs = -1; 70 while ((ch = getopt(argc, argv, "a:d0123456789")) != -1) 71 switch (ch) { 72 case 'a': 73 if (optarg[1] != '\0') 74 errx(1, |
75 "illegal magic character specification."); | 75 "illegal magic character specification"); |
76 magic = optarg[0]; 77 break; 78 case 'd': 79 debug = 1; 80 break; 81 case '0': case '1': case '2': case '3': case '4': 82 case '5': case '6': case '7': case '8': case '9': 83 if (nargs != -1) 84 errx(1, | 76 magic = optarg[0]; 77 break; 78 case 'd': 79 debug = 1; 80 break; 81 case '0': case '1': case '2': case '3': case '4': 82 case '5': case '6': case '7': case '8': case '9': 83 if (nargs != -1) 84 errx(1, |
85 "only one -# argument may be specified."); | 85 "only one -# argument may be specified"); |
86 nargs = optopt - '0'; 87 break; 88 default: 89 usage(); 90 } 91 argc -= optind; 92 argv += optind; 93 --- 133 unchanged lines hidden (view full) --- 227 return(pid == -1 ? -1 : pstat); 228} 229 230void 231usage() 232{ 233 234 (void)fprintf(stderr, | 86 nargs = optopt - '0'; 87 break; 88 default: 89 usage(); 90 } 91 argc -= optind; 92 argv += optind; 93 --- 133 unchanged lines hidden (view full) --- 227 return(pid == -1 ? -1 : pstat); 228} 229 230void 231usage() 232{ 233 234 (void)fprintf(stderr, |
235 "usage: apply [-a magic] [-0123456789] command arguments ...\n"); | 235 "usage: apply [-a magic] [-d] [-0123456789] command arguments ...\n"); |
236 exit(1); 237} | 236 exit(1); 237} |