diff options
author | rgrimes <rgrimes@FreeBSD.org> | 1995-05-30 06:41:30 +0000 |
---|---|---|
committer | rgrimes <rgrimes@FreeBSD.org> | 1995-05-30 06:41:30 +0000 |
commit | a14d555c873398b14776ca4f2c33f9c69617afb9 (patch) | |
tree | 350f6f98843363254f9afe467ae0c92d5a9d7f43 /usr.bin/find | |
parent | f3a2b348daf9fa6063c38d2d69563f732a2f80e7 (diff) | |
download | FreeBSD-src-a14d555c873398b14776ca4f2c33f9c69617afb9.zip FreeBSD-src-a14d555c873398b14776ca4f2c33f9c69617afb9.tar.gz |
Remove trailing whitespace.
Diffstat (limited to 'usr.bin/find')
-rw-r--r-- | usr.bin/find/find.c | 10 | ||||
-rw-r--r-- | usr.bin/find/function.c | 130 | ||||
-rw-r--r-- | usr.bin/find/main.c | 2 | ||||
-rw-r--r-- | usr.bin/find/misc.c | 4 | ||||
-rw-r--r-- | usr.bin/find/operator.c | 30 |
5 files changed, 88 insertions, 88 deletions
diff --git a/usr.bin/find/find.c b/usr.bin/find/find.c index b1b48ba..d69b098 100644 --- a/usr.bin/find/find.c +++ b/usr.bin/find/find.c @@ -87,7 +87,7 @@ find_formplan(argv) tail = new; } } - + /* * if the user didn't specify one of -print, -ok or -exec, then -print * is assumed so we add a -print node on the end. It is possible that @@ -110,7 +110,7 @@ find_formplan(argv) tail = new; } } - + /* * the command line has been completely processed into a search plan * except for the (, ), !, and -o operators. Rearrange the plan so @@ -139,7 +139,7 @@ find_formplan(argv) plan = or_squish(plan); /* -o's */ return (plan); } - + FTS *tree; /* pointer to top of FTS hierarchy */ /* @@ -155,7 +155,7 @@ find_execute(plan, paths) register FTSENT *entry; PLAN *p; int rval; - + if ((tree = fts_open(paths, ftsoptions, (int (*)())NULL)) == NULL) err(1, "ftsopen"); @@ -185,7 +185,7 @@ find_execute(plan, paths) rval = 1; continue; } - + /* * Call all the functions in the execution plan until one is * false or all have been executed. This is where we do all diff --git a/usr.bin/find/function.c b/usr.bin/find/function.c index 52e0f43..72a4e74 100644 --- a/usr.bin/find/function.c +++ b/usr.bin/find/function.c @@ -84,7 +84,7 @@ find_parsenum(plan, option, vp, endch) { long value; char *endchar, *str; /* Pointer to character ending conversion. */ - + /* Determine comparison from leading + or -. */ str = vp; switch (*str) { @@ -100,7 +100,7 @@ find_parsenum(plan, option, vp, endch) plan->flags = F_EQUAL; break; } - + /* * Convert the string with strtol(). Note, if strtol() returns zero * and endchar points to the beginning of the string we know we have @@ -142,7 +142,7 @@ f_atime(plan, entry) COMPARE((now - entry->fts_statp->st_atime + SECSPERDAY - 1) / SECSPERDAY, plan->t_data); } - + PLAN * c_atime(arg) char *arg; @@ -172,7 +172,7 @@ f_ctime(plan, entry) COMPARE((now - entry->fts_statp->st_ctime + SECSPERDAY - 1) / SECSPERDAY, plan->t_data); } - + PLAN * c_ctime(arg) char *arg; @@ -201,7 +201,7 @@ f_always_true(plan, entry) { return (1); } - + PLAN * c_depth() { @@ -209,7 +209,7 @@ c_depth() return (palloc(N_DEPTH, f_always_true)); } - + /* * [-exec | -ok] utility [arg ... ] ; functions -- * @@ -256,7 +256,7 @@ f_exec(plan, entry) pid = waitpid(pid, &status, 0); return (pid != -1 && WIFEXITED(status) && !WEXITSTATUS(status)); } - + /* * c_exec -- * build three parallel arrays, one with pointers to the strings passed @@ -274,7 +274,7 @@ c_exec(argvp, isok) register char **argv, **ap, *p; isoutput = 1; - + new = palloc(N_EXEC, f_exec); if (isok) new->flags = F_NEEDOK; @@ -310,7 +310,7 @@ c_exec(argvp, isok) *argvp = argv + 1; return (new); } - + /* * -follow functions -- * @@ -325,7 +325,7 @@ c_follow() return (palloc(N_FOLLOW, f_always_true)); } - + /* * -fstype functions -- * @@ -360,8 +360,8 @@ f_fstype(plan, entry) p[0] = '.'; save[1] = p[1]; p[1] = '\0'; - - } else + + } else p = NULL; if (statfs(entry->fts_accpath, &sb)) @@ -386,22 +386,22 @@ f_fstype(plan, entry) } switch(plan->flags) { case F_MTFLAG: - return (val & plan->mt_data); + return (val & plan->mt_data); case F_MTTYPE: return (val == plan->mt_data); default: abort(); } } - + PLAN * c_fstype(arg) char *arg; { register PLAN *new; - + ftsoptions &= ~FTS_NOSTAT; - + new = palloc(N_FSTYPE, f_fstype); switch (*arg) { case 'l': @@ -450,7 +450,7 @@ c_fstype(arg) errx(1, "%s: unknown file type", arg); /* NOTREACHED */ } - + /* * -group gname functions -- * @@ -465,7 +465,7 @@ f_group(plan, entry) { return (entry->fts_statp->st_gid == plan->g_data); } - + PLAN * c_group(gname) char *gname; @@ -473,7 +473,7 @@ c_group(gname) PLAN *new; struct group *g; gid_t gid; - + ftsoptions &= ~FTS_NOSTAT; g = getgrnam(gname); @@ -483,7 +483,7 @@ c_group(gname) errx(1, "-group: %s: no such group", gname); } else gid = g->gr_gid; - + new = palloc(N_GROUP, f_group); new->g_data = gid; return (new); @@ -501,20 +501,20 @@ f_inum(plan, entry) { COMPARE(entry->fts_statp->st_ino, plan->i_data); } - + PLAN * c_inum(arg) char *arg; { PLAN *new; - + ftsoptions &= ~FTS_NOSTAT; - + new = palloc(N_INUM, f_inum); new->i_data = find_parsenum(new, "-inum", arg, NULL); return (new); } - + /* * -links n functions -- * @@ -527,20 +527,20 @@ f_links(plan, entry) { COMPARE(entry->fts_statp->st_nlink, plan->l_data); } - + PLAN * c_links(arg) char *arg; { PLAN *new; - + ftsoptions &= ~FTS_NOSTAT; - + new = palloc(N_LINKS, f_links); new->l_data = (nlink_t)find_parsenum(new, "-links", arg, NULL); return (new); } - + /* * -ls functions -- * @@ -554,13 +554,13 @@ f_ls(plan, entry) printlong(entry->fts_path, entry->fts_accpath, entry->fts_statp); return (1); } - + PLAN * c_ls() { ftsoptions &= ~FTS_NOSTAT; isoutput = 1; - + return (palloc(N_LS, f_ls)); } @@ -580,7 +580,7 @@ f_mtime(plan, entry) COMPARE((now - entry->fts_statp->st_mtime + SECSPERDAY - 1) / SECSPERDAY, plan->t_data); } - + PLAN * c_mtime(arg) char *arg; @@ -608,7 +608,7 @@ f_name(plan, entry) { return (!fnmatch(plan->c_data, entry->fts_name, 0)); } - + PLAN * c_name(pattern) char *pattern; @@ -619,7 +619,7 @@ c_name(pattern) new->c_data = pattern; return (new); } - + /* * -newer file functions -- * @@ -634,14 +634,14 @@ f_newer(plan, entry) { return (entry->fts_statp->st_mtime > plan->t_data); } - + PLAN * c_newer(filename) char *filename; { PLAN *new; struct stat sb; - + ftsoptions &= ~FTS_NOSTAT; if (stat(filename, &sb)) @@ -650,7 +650,7 @@ c_newer(filename) new->t_data = sb.st_mtime; return (new); } - + /* * -nogroup functions -- * @@ -666,7 +666,7 @@ f_nogroup(plan, entry) return (group_from_gid(entry->fts_statp->st_gid, 1) ? 0 : 1); } - + PLAN * c_nogroup() { @@ -674,7 +674,7 @@ c_nogroup() return (palloc(N_NOGROUP, f_nogroup)); } - + /* * -nouser functions -- * @@ -690,7 +690,7 @@ f_nouser(plan, entry) return (user_from_uid(entry->fts_statp->st_uid, 1) ? 0 : 1); } - + PLAN * c_nouser() { @@ -698,7 +698,7 @@ c_nouser() return (palloc(N_NOUSER, f_nouser)); } - + /* * -path functions -- * @@ -712,7 +712,7 @@ f_path(plan, entry) { return (!fnmatch(plan->c_data, entry->fts_path, 0)); } - + PLAN * c_path(pattern) char *pattern; @@ -723,7 +723,7 @@ c_path(pattern) new->c_data = pattern; return (new); } - + /* * -perm functions -- * @@ -746,7 +746,7 @@ f_perm(plan, entry) return (mode == plan->m_data); /* NOTREACHED */ } - + PLAN * c_perm(perm) char *perm; @@ -769,7 +769,7 @@ c_perm(perm) new->m_data = getmode(set, 0); return (new); } - + /* * -print functions -- * @@ -784,7 +784,7 @@ f_print(plan, entry) (void)printf("%s\n", entry->fts_path); return (1); } - + PLAN * c_print() { @@ -792,7 +792,7 @@ c_print() return (palloc(N_PRINT, f_print)); } - + /* * -print0 functions -- * @@ -808,7 +808,7 @@ f_print0(plan, entry) fputc('\0', stdout); return (1); } - + PLAN * c_print0() { @@ -816,7 +816,7 @@ c_print0() return (palloc(N_PRINT0, f_print0)); } - + /* * -prune functions -- * @@ -833,13 +833,13 @@ f_prune(plan, entry) err(1, "%s", entry->fts_path); return (1); } - + PLAN * c_prune() { return (palloc(N_PRUNE, f_prune)); } - + /* * -size n[c] functions -- * @@ -861,14 +861,14 @@ f_size(plan, entry) FIND_SIZE : entry->fts_statp->st_size; COMPARE(size, plan->o_data); } - + PLAN * c_size(arg) char *arg; { PLAN *new; char endch; - + ftsoptions &= ~FTS_NOSTAT; new = palloc(N_SIZE, f_size); @@ -878,7 +878,7 @@ c_size(arg) divsize = 0; return (new); } - + /* * -type c functions -- * @@ -893,14 +893,14 @@ f_type(plan, entry) { return ((entry->fts_statp->st_mode & S_IFMT) == plan->m_data); } - + PLAN * c_type(typestring) char *typestring; { PLAN *new; mode_t mask; - + ftsoptions &= ~FTS_NOSTAT; switch (typestring[0]) { @@ -928,12 +928,12 @@ c_type(typestring) default: errx(1, "-type: %s: unknown type", typestring); } - + new = palloc(N_TYPE, f_type); new->m_data = mask; return (new); } - + /* * -user uname functions -- * @@ -948,7 +948,7 @@ f_user(plan, entry) { return (entry->fts_statp->st_uid == plan->u_data); } - + PLAN * c_user(username) char *username; @@ -956,7 +956,7 @@ c_user(username) PLAN *new; struct passwd *p; uid_t uid; - + ftsoptions &= ~FTS_NOSTAT; p = getpwnam(username); @@ -971,7 +971,7 @@ c_user(username) new->u_data = uid; return (new); } - + /* * -xdev functions -- * @@ -1003,7 +1003,7 @@ f_expr(plan, entry) p && (state = (p->eval)(p, entry)); p = p->next); return (state); } - + /* * N_OPENPAREN and N_CLOSEPAREN nodes are temporary place markers. They are * eliminated during phase 2 of find_formplan() --- the '(' node is converted @@ -1014,13 +1014,13 @@ c_openparen() { return (palloc(N_OPENPAREN, (int (*)())-1)); } - + PLAN * c_closeparen() { return (palloc(N_CLOSEPAREN, (int (*)())-1)); } - + /* * ! expression functions -- * @@ -1038,13 +1038,13 @@ f_not(plan, entry) p && (state = (p->eval)(p, entry)); p = p->next); return (!state); } - + PLAN * c_not() { return (palloc(N_NOT, f_not)); } - + /* * expression -o expression functions -- * diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c index c8375863..6cc6435 100644 --- a/usr.bin/find/main.c +++ b/usr.bin/find/main.c @@ -111,7 +111,7 @@ main(argc, argv) break; } - argc -= optind; + argc -= optind; argv += optind; if (Hflag) diff --git a/usr.bin/find/misc.c b/usr.bin/find/misc.c index 1db34ce..71316ee 100644 --- a/usr.bin/find/misc.c +++ b/usr.bin/find/misc.c @@ -49,7 +49,7 @@ static char sccsid[] = "@(#)misc.c 8.2 (Berkeley) 4/1/94"; #include <string.h> #include "find.h" - + /* * brace_subst -- * Replace occurrences of {} in s1 with s2 and return the result string. @@ -110,7 +110,7 @@ queryuser(argv) } return (first == 'y'); } - + /* * emalloc -- * malloc with error checking. diff --git a/usr.bin/find/operator.c b/usr.bin/find/operator.c index a706b88..d7c6015 100644 --- a/usr.bin/find/operator.c +++ b/usr.bin/find/operator.c @@ -45,24 +45,24 @@ static char sccsid[] = "@(#)operator.c 8.1 (Berkeley) 6/6/93"; #include <stdio.h> #include "find.h" - + /* * yanknode -- * destructively removes the top from the plan */ static PLAN * -yanknode(planp) +yanknode(planp) PLAN **planp; /* pointer to top of plan (modified) */ { PLAN *node; /* top node removed from the plan */ - + if ((node = (*planp)) == NULL) return (NULL); (*planp) = (*planp)->next; node->next = NULL; return (node); } - + /* * yankexpr -- * Removes one expression from the plan. This is used mainly by @@ -70,7 +70,7 @@ yanknode(planp) * simple node or a N_EXPR node containing a list of simple nodes. */ static PLAN * -yankexpr(planp) +yankexpr(planp) PLAN **planp; /* pointer to top of plan (modified) */ { register PLAN *next; /* temp node holding subexpression results */ @@ -78,11 +78,11 @@ yankexpr(planp) PLAN *tail; /* pointer to tail of subplan */ PLAN *subplan; /* pointer to head of ( ) expression */ int f_expr(); - + /* first pull the top node from the plan */ if ((node = yanknode(planp)) == NULL) return (NULL); - + /* * If the node is an '(' then we recursively slurp up expressions * until we find its associated ')'. If it's a closing paren we @@ -119,7 +119,7 @@ yankexpr(planp) } return (node); } - + /* * paren_squish -- * replaces "parentheisized" plans in our search plan with "expr" nodes. @@ -131,7 +131,7 @@ paren_squish(plan) register PLAN *expr; /* pointer to next expression */ register PLAN *tail; /* pointer to tail of result plan */ PLAN *result; /* pointer to head of result plan */ - + result = tail = NULL; /* @@ -157,7 +157,7 @@ paren_squish(plan) } return (result); } - + /* * not_squish -- * compresses "!" expressions in our search plan. @@ -170,9 +170,9 @@ not_squish(plan) register PLAN *node; /* temporary node used in N_NOT processing */ register PLAN *tail; /* pointer to tail of result plan */ PLAN *result; /* pointer to head of result plan */ - + tail = result = next = NULL; - + while ((next = yanknode(&plan)) != NULL) { /* * if we encounter a ( expression ) then look for nots in @@ -215,7 +215,7 @@ not_squish(plan) } return (result); } - + /* * or_squish -- * compresses -o expressions in our search plan. @@ -227,9 +227,9 @@ or_squish(plan) register PLAN *next; /* next node being processed */ register PLAN *tail; /* pointer to tail of result plan */ PLAN *result; /* pointer to head of result plan */ - + tail = result = next = NULL; - + while ((next = yanknode(&plan)) != NULL) { /* * if we encounter a ( expression ) then look for or's in |