From: Jim Meyering Date: Sat, 20 May 2006 22:18:16 +0000 (+0000) Subject: (fts_open): Fail with EINVAL if a caller violates this rule: X-Git-Tag: v6.0~375 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8fb9de41d5669147a8b514c5950a1b05f64e477e;p=thirdparty%2Fcoreutils.git (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. --- diff --git a/lib/fts.c b/lib/fts.c index 2d4e33321c..5ea1397004 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)