(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.
This commit is contained in:
Jim Meyering committed 2006-05-20 22:18:16 +00:00
1 parent 6776bb7d30
commit 8fb9de41d5
1 file changed
+4
+4
View File
@@ -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)