summaryrefslogtreecommitdiff
path: root/lib/fts.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-05-20 22:18:16 +0000
committerJim Meyering <jim@meyering.net>2006-05-20 22:18:16 +0000
commit8fb9de41d5669147a8b514c5950a1b05f64e477e (patch)
tree60c670838948bff87facf12b6374bc3da28f167c /lib/fts.c
parent6776bb7d3077182e4a227a315d17257edf2d12f5 (diff)
downloadcoreutils-8fb9de41d5669147a8b514c5950a1b05f64e477e.tar.xz
(fts_open): Fail with EINVAL if a caller violates this rule:
Either FTS_LOGICAL or FTS_PHYSICAL must be provided to the fts_open() function.
Diffstat (limited to 'lib/fts.c')
-rw-r--r--lib/fts.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/fts.c b/lib/fts.c
index 2d4e33321..5ea139700 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -291,6 +291,10 @@ fts_open (char * const *argv,
__set_errno (EINVAL);
return (NULL);
}
+ if ( ! (options & (FTS_LOGICAL | FTS_PHYSICAL))) {
+ __set_errno (EINVAL);
+ return (NULL);
+ }
/* Allocate/initialize the stream */
if ((sp = malloc(sizeof(FTS))) == NULL)