Deleted Added
full compact
fts.c (189348) fts.c (197793)
1/*-
2 * Copyright (c) 1990, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31
32#if 0
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
35#endif /* LIBC_SCCS and not lint */
36#endif
37
38#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1990, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 22 unchanged lines hidden (view full) ---

31
32#if 0
33#if defined(LIBC_SCCS) && !defined(lint)
34static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
35#endif /* LIBC_SCCS and not lint */
36#endif
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/lib/libc/gen/fts.c 189348 2009-03-04 03:30:21Z das $");
39__FBSDID("$FreeBSD: head/lib/libc/gen/fts.c 197793 2009-10-05 21:11:04Z delphij $");
40
41#include "namespace.h"
42#include <sys/param.h>
43#include <sys/mount.h>
44#include <sys/stat.h>
45
46#include <dirent.h>
47#include <errno.h>

--- 71 unchanged lines hidden (view full) ---

119 size_t len, nitems;
120
121 /* Options check. */
122 if (options & ~FTS_OPTIONMASK) {
123 errno = EINVAL;
124 return (NULL);
125 }
126
40
41#include "namespace.h"
42#include <sys/param.h>
43#include <sys/mount.h>
44#include <sys/stat.h>
45
46#include <dirent.h>
47#include <errno.h>

--- 71 unchanged lines hidden (view full) ---

119 size_t len, nitems;
120
121 /* Options check. */
122 if (options & ~FTS_OPTIONMASK) {
123 errno = EINVAL;
124 return (NULL);
125 }
126
127 /* fts_open() requires at least one path */
128 if (*argv == NULL) {
129 errno = EINVAL;
130 return (NULL);
131 }
132
127 /* Allocate/initialize the stream. */
128 if ((priv = malloc(sizeof(*priv))) == NULL)
129 return (NULL);
130 memset(priv, 0, sizeof(*priv));
131 sp = &priv->ftsp_fts;
132 sp->fts_compar = compar;
133 sp->fts_options = options;
134

--- 1062 unchanged lines hidden ---
133 /* Allocate/initialize the stream. */
134 if ((priv = malloc(sizeof(*priv))) == NULL)
135 return (NULL);
136 memset(priv, 0, sizeof(*priv));
137 sp = &priv->ftsp_fts;
138 sp->fts_compar = compar;
139 sp->fts_options = options;
140

--- 1062 unchanged lines hidden ---